I am having an issue testing a release build on my device. If I use the app using flutter run or flutter run --release, the app runs with no errors reported and I can use the app without issue. However, using the generated APK from flutter build apk, the app crashes immediately stating the app failed to launch.
I have followed everything from here https://flutter.dev/docs/deployment/android#building-the-app-for-release so that shouldn't be the issue.
How do I begin to debug this issue?
This is the output from Flutter Doctor -v
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.7 19H2, locale en-GB)
• Flutter version 1.20.4 at /Users/student/flutter
• Framework revision fba99f6cf9 (3 weeks ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/student/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.9.1
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.49.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.15.0
With release mode. You can debug what's going on with https://fbflipper.com. Just download Flipper tool, install and run it and watch the logs.
Anyway, you can consider my points about android crash:
Wrong arch: check architecture supported between apk and device
Check broken in native libraries or class not found: Some libraries broken reference in release with ProGuard
Manifest broken: Some thing kind of missing or incorrect in configuration of manifest file
Related
I have been working on a flutter project for a long time. Now I have set up my new laptop and after reinstalling the tools for VS Code(Flutter, Android Studio) I face the error mentioned in the title of this question.
Error: Null safety features are disabled for this library.
Try removing the package language version or setting the language version to 2.10 or higher.
As advised, I have set my flutter-sdk version to >= 2.10.0 but it is still not working.
To enable the NNBD I would have to enable experimental support but people advise against it until it is fully released. So what should I do to get my codebase working? Enable NNBD experimental support or is there any other solution?
Here is my flutter doctor:
[√] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.19041.572], locale en-AT)
• Flutter version 1.22.3 at C:\flutter
• Framework revision 8874f21e79 (6 days ago), 2020-10-29 14:14:35 -0700
• Engine revision a1440ca392
• Dart version 2.10.3
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\xyz\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.50.1)
• VS Code at C:\Users\xyz\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.16.0
[√] Connected device (1 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator)
! Doctor found issues in 2 categories.
If needed, I will provide extra information/logs/files.
I resolved running flutter clean and flutter pub get again.
My app works perfectly on the Android emulator. When I create a release APK I get this error:
Intermittently, the Scaffold content does not load. The Nav bar and drawer are visible, but not the central content.
This does not happen every time I open the app, only about 1/3 times, on average. There is no obvious pattern to this working or failing.
[✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.11.6 15G22010,
locale en)
• Flutter version 1.12.13+hotfix.7 at /Applications/flutter
• Framework revision 9f5ff2306b (3 days ago), 2020-01-26 22:38:26 -0800
• Engine revision a67792536c
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/dan/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS
development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin
code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.41.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.7.1
[✓] Connected device (1 available)
• klte • 5d3f96b0 • android-arm • Android 7.1.2 (API 25)
I have a similar case, the scaffold is not drawn, it is as if it were empty, for the moment the solution I found was to generate the apk but in debug mode, change flutter build apk --release to flutter build --debug .
since I upgraded my MacBook to macOS Catalina. I'm getting permanent the message ("ideviceinfo" could not be open, because the developer is not verified) despite I disabled the "spctl". can somebody help please?
I downloaded the flutter version flutter_macos_v1.9.1+hotfix.4-stable.zip AND i use the Andriod Studio 3.5.1.
[✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Mac OS X 10.15 19A583, locale de-DE)
• Flutter version 1.9.1+hotfix.4 at /Users/yousefmosa/0/prg/flutter
• Framework revision cc949a8e8b (2 weeks ago), 2019-09-27 15:04:59 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/yousefmosa/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
pod setup
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 40.1.2
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] IntelliJ IDEA Community Edition (version 2019.1.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 37.0.3
• Dart plugin version 191.7830
[✓] VS Code (version 1.37.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.3.0
[✓] Connected device (1 available)
• iPhone 11 Pro Max • XXX-6B2F-XXX-9B01-XXXXXX • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-0 (simulator)
! Doctor found issues in 2 categories.
From macOS "System Preferences..." > "Security & Privacy" > "General" tab ,
you see the dart entry. Just press "Allow Anyway"
Go to System preferences -> General and allow "dart" to run
Type these command in terminal
sudo xattr -d com.apple.quarantine YourflutterSDKLocation/bin/cache/artifacts/libimobiledevice/ideviceinfo
This is because of recent changes in macOS Catalina.
sudo spctl --add "Path_to_flutter/bin/cache/artifacts/libimobiledevice/ideviceinfo"
You might need to reboot the system in order to apply the changes.
You can run a GateKeeper script to fix the issue.
I have published an article with more information how to fix this.
Hi i build app and upload to google play console.
i got this error !
Error Your app has an apk with version code 1 that requests the
following permission(s): android.permission.CAMERA. Apps using these
permissions in an APK are required to have a privacy policy set.
but acctually i dont use camera or camera permission. in AndroidManifest.xml also just android.permission.INTERNET
then i read from flutter website that flutter build appbundle will compiled for armeabi-v7a (32-bit) and arm64-v8a (64-bit).
but i got this warning on play console
This release is not compliant with the Google Play 64-bit requirement
The following APKs or App Bundles are available to 64-bit devices, but
they only have 32-bit native code: 1.
please help me with this 2 problem :(
flutter doctor
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.18362.207], locale en-ID)
• Flutter version 1.5.4-hotfix.2 at C:\flutter
• Framework revision 7a4c33425d (2 months ago), 2019-04-29 11:05:24 -0700
• Engine revision 52c7a1e849
• Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
• Android SDK at C:\Users\KLIK-EAT\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[√] Android Studio (version 3.4)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 36.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[√] VS Code (version 1.36.0)
• VS Code at C:\Users\KLIK-EAT\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.2.0
[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
thanks already fixed
1. for camera uses-permission android:name="android.permission.CAMERA" tools:node="remove"
2. for 64bit bundle, i update to latest flutter stabil and it build 64.
I used flutter to make a small app, I publish it on the play store. Problem is, I can't install on any avd I have. I get the "your device is not compatible with this version" (or a similar message depending on the android version I tried with).
I just followed the instructions on how to make an apk and an app bundle (they both didn't work). How can I make it downloadable and usable in an play store enabled avd ?
Here is a flutter doctor -v
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale
fr-FR)
• Flutter version 1.5.4-hotfix.2 at /Users/moo/development/flutter
• Framework revision 7a4c33425d (6 weeks ago), 2019-04-29 11:05:24 -0700
• Engine revision 52c7a1e849
• Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/moo/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
• ios-deploy 1.9.4
• CocoaPods version 1.7.1
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 36.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build
1.8.0_152-release-1343-b01)
[✓] VS Code (version 1.35.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.1.0
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.0 (API
24) (emulator)
You can't install an apk from the store written in flutter on the emulator because the ABI of the emulator is x86, and the apk in release mode(the mode that is on the store) can't be installed on devices with x86 ABI.
You can't even run the application in release mode on the emulator