Skip to content
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

Release version not working (Android) #1

Closed
aftabIDE opened this issue Apr 20, 2023 · 6 comments
Closed

Release version not working (Android) #1

aftabIDE opened this issue Apr 20, 2023 · 6 comments

Comments

@aftabIDE
Copy link

First of all Thanks for such an wonderful work.
There is an issue arise in release mode the app is not working but it is working in debug mode.

Possible cause: Wireguard packages might be removed due to pro-guard while creating release apk.

Looking for your response.
Thank you.

@vovacmig
Copy link

If you open up the plugin code, you won't find anything about wireguard. The source code of the tunnel itself has not been added yet.

@vovacmig
Copy link

If the author is just starting to write a project, the working version should not be expected before six months.

@ByteSizedMarius
Copy link

ByteSizedMarius commented Jul 15, 2023

Hello, in ./app/build.gradle in buildtypes release, try adding

shrinkResources false
minifyEnabled false

It seems to work for me. Your suggestion regarding pro-guard might be close :)

Update: I got it working by excluding the relevant classes from being minified by creating the file proguard-rules.pro in your project in android/app, and adding the following two lines:

-keep class app.wachu.wireguard_vpn.** {*;}
-keep class com.beust.klaxon.** {*;}

build.gradle does not need to be modified in that case. Tested with flutter v3.10.5, kt 1.7.10, gradle 7.5 (?)

@Wachu985
Copy link
Owner

Hello, in ./app/build.gradle in buildtypes release, try adding

shrinkResources false
minifyEnabled false

It seems to work for me. Your suggestion regarding pro-guard might be close :)

Update: I got it working by excluding the relevant classes from being minified by creating the file proguard-rules.pro in your project in android/app, and adding the following two lines:

-keep class app.wachu.wireguard_vpn.** {*;}
-keep class com.beust.klaxon.** {*;}

build.gradle does not need to be modified in that case. Tested with flutter v3.10.5, kt 1.7.10, gradle 7.5 (?)

Thank you for the input. I've updated the README.md to include your solution and properly acknowledged your contribution. I believe I can close this issue now.

@Wachu985
Copy link
Owner

Done

@ByteSizedMarius
Copy link

ByteSizedMarius commented Nov 4, 2023

FYI, with Flutter 3.13.7 and Gradle 1.9.10, the proguard rules have stopped working. Disabling minify and shrink still works. I've tested around a bit, but didn't find a fix for the proguard-rules immediately. Soley based on the error message received by flutter, the issue seems to be that the parameters for SetStateParams are somehow lost, so it might be related to Klaxon. Since disabling minify and shrink solves the problem, there are not many options for what the problem could be.

@Wachu985

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants