-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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 build fails to install with signed apk and debug build works with flutter for android #37935
Comments
Significant difference between prod and dev version of apk on size. Tried all the steps of #18494, unable to build a release version that runs. Build happens super fast and file comes less than 11 mb with release, while with debug apk it comes around 40mb+. Debug apk works, while prod release signed apk doesnt install even. |
Thanks for the bug report! Flutter doesn't support deploying release builds to emulators, so what physical device are you trying to deploy to in release mode? (your doctor output only shows a connected emulator) |
/cc @blasten |
I connect my one-plus android phone and tried running It works now with 1.8.1 dev channel on actual device alone, with 1.7.8 +hotfix it fails. If I do a pull latest on the flutter folder, a merge conflict also comes up. Can we trust this and generate an .aab and release to playstore, will it work ? If we take a build opening only android folder in android studio of flutter project like a standard android project, and generate signed apk. It doesn't open up on emulator or actual device. However standard kotlin android project release build works both on emulator & actual device. When can we expect similar experience with flutter projects ? |
Not sure what magic happened now from yest to today, builds are working on actual device, if i use flutter commands. May be my bad I should have tried on a device first. I was behind emulator for release builds to be tested, since used with kotlin projects. Thanks for letting me know that emulator it wont work with release build. will it be fixed in future ? Now the release apk that comes up through --release is about 11.9 mb. why different sizes building from android studio directly through android folder(10.9 mb), or vscode with flutter build apk (18.3 mb) or vscode with flutter run --release (11.9 mb). All have different sizes. Are these flutter core libraries like flutterlib.so etc are part of all android devices now ? So that It picks that to render the app ? |
When you build the APK for release, you need an emulator that can run code compiled for arm32 or arm64. However, if your computer has x64 or x86 CPU, Android Studio suggests an emulator that is compatible with your computer architecture, which might not allow you to run the release APK. |
closing the issue, as I got confirmation that release versions wont work on emulator |
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, including the output of |
Android sdk - 29.0.2
Android Studio - 3.4.2
Flutter - 1.8.1 Dev Channel
Steps to reproduce:
Created a keystore file suing keytool for release build with alias and password
created key.properties file
added these to app -> build.gradle
`
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
added progaurd-rules.pro
## Flutter wrapper -keep class io.flutter.app.** { *; } -keep class io.flutter.plugin.** { *; } -keep class io.flutter.util.** { *; } -keep class io.flutter.view.** { *; } -keep class io.flutter.** { *; } -keep class io.flutter.plugins.** { *; } -keep class com.google.**{*;} -keepclassmembers class * implements java.io.Serializable { *; } #or -keep class com.baseflow.permissionhandler.** { *; }
Ran the build for release, it comes up with an apk and following error on opening in an emulator or actual device.
Flutter doctor -v
`[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.3, Build version 10G8
• CocoaPods version 1.7.3
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 38.2.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] VS Code (version 1.36.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.3.0
[✓] Connected device (3 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28)
(emulator)`
The text was updated successfully, but these errors were encountered: