Problem compiling apk on flutter - R8: Program type already present

Asked

Viewed 139 times

-1

I’m trying to compile apk to flutter, but am getting error in R8, I already have other applications in flutter never had problem to compile, making the tests realize that the problem is being the webview library, when I remove it from pubspec the app compiles like a wonder, however I can not rule out the use of webview at the moment, it is important for the app, the strange thing is that I can debug the app on the device.

I have tried several solutions like these below: gradlew clean in flutter/android design flutter clean update to the latest version of webview dependency on pub spec. already switched to flutter master channel and also executed flutter upgrade but nothing solves the problem.

follows the error:

R8: Program type already present: io.flutter.plugins.webviewflutter.BuildConfig

FAILURE: Build failed with an exception.


* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithR8ForRelease'.
> com.android.tools.r8.CompilationFailedException: Compilation failed to complete
  • Tried the proposals listed on this site: https://github.com/flutter/flutter/issues/40830 ?

  • That was one of the first ones I made.

1 answer

1

Try to open your project in andorid studio, just the same part of java, see if you need to update some library, if you need to update some version of any of the plugins, if all the plugins comply with the flutter version.

  • so I’m using intelij I’ve already done pub get, flutter upgrade but nothing solves, another observation is, I’ve reviewed most libraries and checked pubspeck one by one to see if it came out new version

  • by android studio it shows each plugin and the recommended version for each according to Gradle and flutter

  • 1

    so I did like you said but I didn’t see anything different, still with the same error, there pubspeck does not warn anything, and there is I do not know if you used intelij but intelij is practically android studio the difference is that it is cleaner by being an IDE for several other languages.

  • No, I’ve never used it. So I don’t know what it might be.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.