-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build error with latest flutter/agp versions #2139
Comments
NOTE: This comment is auto-generated. Are you sure you have already searched for the same problem? Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem! If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue. In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding Following these steps can save you, me, and other people a lot of time, thanks! |
It would be great if the according PR could be merged quickly, as this currently blocks us (and probably other devs as well) from building releases, and downgrading to an earlier version is quite cumbersome as the API has changed in between. |
Any luck pointing your dependency to the pull request? it doesn't work on my side |
Ah, good point!
|
I closed the according PR because it was a duplicate of #2102 |
You saved my deploy today. Thank you so much! |
Still having an issue even afetr depending on
|
@specOper99 - looks like your issue is not linked to flutter_inappwebview, but that fact that your proguard.pro file is not there. -ignorewarnings |
@nayanbabariya yes, this wasn't my issue, but i was also replying to the comment above mine, stating that his issue was something else. |
@Yohan-J Okay. but the mentioned issue is from the |
@Yohan-J Thank you for your answer. |
In my case, it seems the issue was caused by youtube_player_flutter that depends on flutter_inappwebview |
For Flutter project this is :
In Flutter still get an error : It seems that this upgraded package version with
added to Proguard . This causes missing classes when running Flutter project This fix of https://github.com/MobileEasternts/flutter_inappwebview/tree/master is more complete and the branch master has the correction done which solves this issue
|
the same here |
the same here. my error code
Add 1
Add 2
The build was successful with the two additional methods above. Thanks a lot. |
Sorry, where am i putting this add, which file, Gradle or proguard? |
The first add goes to your The second one is not required in my setup, so you might not need it either. But if you do, this goes to the |
Noted with thanks, let me do that and build.
…On Wed, Jul 3, 2024, 15:59 Sergio Molchanovsky ***@***.***> wrote:
Ah, good point! Got it to run with:
dependency_overrides:
# TODO: Recheck once flutter_inappwebview version >6.0.0 is released
flutter_inappwebview_android:
git:
url: https://github.com/holzgeist/flutter_inappwebview
path: flutter_inappwebview_android
ref: d89b1d3
After I added dependency_overrides, my apk size increased from 60 Mb to
almost 110 Mb!
Seems like you turned off some Proguard rules, and some unneeded stuff got
into the assembly.
—
Reply to this email directly, view it on GitHub
<#2139 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMS3LJIU4U3FGOGHOXJFWS3ZKP7TBAVCNFSM6AAAAABHV2CYFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBWGE3DKMJVGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm still sitting on a flutter_inappwebview 5.8, and we managed to remove this R8 error by adding the following line in the beginning of the project.gradle.startParameter.excludedTaskNames.add(":flutter_inappwebview:minifyReleaseWithR8") I hope it will help to someone. |
This really helps |
We tried @subzero911 's fix (which seems better than referencing a PR branch) but did not work for our app, because when building from clean repo, skipping the minification task caused other tasks to fail because they weren't finding the expected output (the jar file). This is an evolution of that fix, which properly disables minification instead of skipping the task, and for us it works even when building from scratch.
If your file already has a subprojects / afterEvaluate section you might have to put it in there instead. Anyway, should the minification be enabled for an open source android library project? I think that generally it shoudn't, because the code would be merged with the whole app's codebase and minification would then run globally.. so a better "official" fix could be to change |
I still have this problem and none of solutions provided is working for me. |
I encountered evaluation timing issues when configure within the
|
I'm still on version 5.8.0 because of some reasons, tried both methods above from @cc-rock and @HelmiAshraf and none of them worked :( I can see the I also added Did anyone manage to build in release mode with the version 5.8? Actually, did upgrading to 6.0.0 fixes the issue or not? |
After I upgrade to Gradle 8.5, this solution works. |
Fixes build error, related to pichillilorenzo#2139
@edisonlsm I'm using 5.8.0 and I made it work with @HelmiAshraf solution but you need to change "flutter_inappwebview_android" to "flutter_inappwebview" on version "5.x.x" |
Since the branch is no longer available (at least I can't connect to the branch anymore when run My
Another problem, if it is a "problem", the package Hope this package get and update soon! (8 months since last time to this days) |
Thanks bro for the update
…On Wed, Sep 11, 2024, 15:42 Juan Manuel Flecha ***@***.***> wrote:
We tried @subzero911 <https://github.com/subzero911> 's fix (which seems
better than referencing a PR branch) but did not work for our app, because
when building from clean repo, skipping the minification task caused other
tasks to fail because they weren't finding the expected output (the jar
file).
This is an evolution of that fix, which properly disables minification
instead of skipping the task, and for us it works even when building from
scratch. Add this in the android/build.gradle file:
subprojects {
afterEvaluate {
if (it.name == "flutter_inappwebview_android") {
it.android.buildTypes.release.minifyEnabled = false
}
}
}
If your file already has a subprojects / afterEvaluate section you might
have to put it in there instead.
Anyway, should the minification be enabled for an open source android
library project? I think that generally it shoudn't, because the code would
be merged with the whole app's codebase and minification would then run
globally.. so a better "official" fix could be to change minifyEnabled to
false in this project's build.gradle. @pichillilorenzo
<https://github.com/pichillilorenzo> what do you think?
Since the branch is no longer available (at least I can't connect to the
branch anymore when run pub get), this solution works by far.
My build.gradle is this right now:
allprojects {
repositories {
google()
mavenCentral()
}
// --------------------- ADDED HERE ---------------------
subprojects {
afterEvaluate {
if (it.name == "flutter_inappwebview_android") {
it.android.buildTypes.release.minifyEnabled = false
}
}
}
}
// AND THIS IS THE REST OF MY GRADLE...
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Another problem, if it is a "problem", the package youtube_player_flutter:
^9.0.0 depends on flutter_inappwebview: ^6.0.0, and I cannot downgrade to
inappwebview 5.8.0
Hope this package get and update soon! (8 months since last time to this
days)
—
Reply to this email directly, view it on GitHub
<#2139 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMS3LJJY5VH33W4PZ3ANCNTZWBCERAVCNFSM6AAAAABHV2CYFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBTG4YTENZYGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Is there any other package because it is still not working, same warning? |
For everyone who wants hotfix and waiting for update. You can comment version
|
Thanks, now its working perfectly |
Any update? |
Fixed in v6.1.1 |
@cc-rock I think you are right, so the developer should know what to "-keep" inside the proguard-rules.pro file of the his/her App in case the minification is enabled. |
This works with release builds, But I am unable to open browser any idea why. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue. |
Environment
Device information: irrelevant, as this is a build error
Description
Expected behavior:
Be able to compile an app on Android using this plugin with obfuscation/minification
Current behavior:
Build error during minification:
Steps to reproduce
flutter build apk --obfuscate --split-debug-info /tmp/debug-info
. Alternatively, skip--obfuscate --split-debug-info ...
and setminifyEnabled true
inandroid/app/build.gradle
The text was updated successfully, but these errors were encountered: