Skip to content

Can't run application in release mode #14385

Closed

Description

@braulio94

Steps to Reproduce

run flutter run --release

Flutter recognizes my real phone as emulator and won't run application in release mode

Logs

Release mode is not supported for emulators.

Flutter Doctor

[√] Flutter (on Microsoft Windows [Version 10.0.16299.192], locale en-US, channel alpha)
    • Flutter version 0.0.21 at C:\Users\Braulio\flutter
    • Framework revision 2e449f06f0 (35 hours ago), 2018-01-29 14:26:51 -0800
    • Engine revision 6921873c71
    • Tools Dart version 2.0.0-dev.16.0
    • Engine Dart version 2.0.0-edge.da1f52592ef73fe3afa485385cb995b9aec0181a

[√] Android toolchain - develop for Android devices (Android SDK 27.0.2)
    • Android SDK at C:\Users\Braulio\AppData\Local\Android\sdk
    • Android NDK at C:\Users\Braulio\AppData\Local\Android\sdk\ndk-bundle
    • Platform android-27, build-tools 27.0.2
    • Java binary at: C:\Program Files\Android\AndroidStudio3.0\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] Android Studio (version 2.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[√] Android Studio (version 3.0)
    • Android Studio at C:\Program Files\Android\AndroidStudio3.0
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] IntelliJ IDEA Ultimate Edition (version 2017.2)
    • Flutter plugin version 18.2
    • Dart plugin version 172.4343.25

[√] Connected devices
   • SM A510F • 3300706128e61383 • android-arm • Android 7.0 (API 24) (emulator)

Activity

  1. PapyElGringo commented on Feb 16, 2018

    @PapyElGringo

    Same for me and same phone:

    [✓] Flutter (on Linux, locale en_US.UTF-8, channel dev)
        • Flutter version 0.1.2 at /home/papyelgringo/flutter
        • Framework revision 8a65872ef9 (3 days ago), 2018-02-13 23:32:28 -0800
        • Engine revision 05c5f817eb
        • Tools Dart version 2.0.0-dev.22.0
        • Engine Dart version 2.0.0-edge.3c4dccbd46f152be9e1b6ca95c57357e8e48057c
    
    [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
        • Android SDK at /home/papyelgringo/Android/Sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-27, build-tools 27.0.3
        • ANDROID_HOME = /home/papyelgringo/Android/Sdk
        • Java binary at: /opt/android-studio/jre/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
    
    [✓] Android Studio (version 3.0)
        • Android Studio at /opt/android-studio
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
    
    [✓] Connected devices
        • SM A510F • 3300d98f24f1a2e1 • android-arm • Android 7.0 (API 24) (emulator)
    
    • No issues found!
    
  2. jack4git commented on Mar 3, 2018

    @jack4git

    Same here:

    [✓] Flutter (Channel beta, v0.1.5, on Mac OS X 10.13.3 17D102, locale en-US)
        • Flutter version 0.1.5 at /Users/jackivers/Projects/Flutter/flutter
        • Framework revision 3ea4d06340 (9 days ago), 2018-02-22 11:12:39 -0800
        • Engine revision ead227f118
        • Dart version 2.0.0-dev.28.0.flutter-0b4f01f759
    
    [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
        • Android SDK at /Users/jackivers/Library/Android/sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-27, build-tools 27.0.3
        • ANDROID_HOME = /Users/jackivers/Library/Android/sdk
        • 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-915-b08)
    
    [✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 9.2, Build version 9C40b
        • ios-deploy 1.9.2
        • CocoaPods version 1.4.0
    
    [✓] Android Studio (version 3.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
    
    [!] VS Code (version 1.20.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Dart Code extension not installed; install from
          https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code
    
    [✓] Connected devices (1 available)
        • SM J730GM • 5200f375b274b4d9 • android-arm • Android 7.0 (API 24) (emulator)
    
  3. jack4git commented on Mar 3, 2018

    @jack4git

    See also #10203, which was closed. Regressed perhaps or more unrecognized devices ...

  4. vilkh3m commented on Mar 14, 2018

    @vilkh3m
    Contributor

    same on samsung J7 (SM-J730F)

    adb shell getprop ro.build.characteristics
    phone,emulator
    
    adb shell getprop ro.hardware
    samsungexynos7870
    
    flutter devices
    SM J730F • 520048c0fa2ca4d5 • android-arm • Android 7.0 (API 24) (emulator)
    
  5. nevi-me commented on Mar 28, 2018

    @nevi-me

    The whitelisted devices at #10203 are too narrow


    EDIT: Looks like beta branch is behind, because I've run flutter upgrade and still end up with Flutter that's 5 weeks old. The device samsungexynos7870 was added to 568ce69 which is in v0.2.4, but I'm still on v0.1.5. @jack4git this might apply to you too


    Mine is:

    $ .\adb.exe shell getprop ro.build.characteristics
    phone,emulator
    $ .\adb.exe shell getprop ro.hardware
    samsungexynos7870
    $ flutter devices
    1 connected device:
    
    SM G610F • 5203f84b5378a381 • android-arm • Android 7.0 (API 24) (emulator)
    
    [√] Flutter (Channel beta, v0.1.5, on Microsoft Windows [Version 10.0.14393], locale en-ZA)
        • Flutter version 0.1.5 at C:\flutter
        • Framework revision 3ea4d06340 (5 weeks ago), 2018-02-22 11:12:39 -0800
        • Engine revision ead227f118
        • Dart version 2.0.0-dev.28.0.flutter-0b4f01f759
    
    [√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
        • Android SDK at C:\AppData\Local\Android\sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-27, build-tools 27.0.3
        • Java binary at: C:\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    
    [√] Android Studio (version 3.1)
        • Android Studio at C:\Android\Android Studio
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    
    [√] IntelliJ IDEA Community Edition (version 2017.3)
        • Flutter plugin version 23.0.2
        • Dart plugin version 173.4700
    
    [√] VS Code (version 1.20.1)
        • VS Code at C:\Microsoft VS Code
        • Dart Code extension version 2.10.0
    
    [√] Connected devices (1 available)
        • SM G610F • 5203f84b5378a381 • android-arm • Android 7.0 (API 24) (emulator)
    
  6. ethael commented on Nov 8, 2018

    @ethael

    Another device is SM G390F (Samsung Galaxy XCover 4)

    $ adb shell getprop ro.build.characteristics
    phone,emulator
    
    $ adb shell getprop ro.hardware
    samsungexynos7570
    
    $ flutter devices
    1 connected device:
    SM G390F • 4200c068069b9457 • android-arm • Android 7.0 (API 24) (emulator)
    
  7. added
    c: crashStack traces logged to the console
    engineflutter/engine related. See also e: labels.
    on Dec 12, 2018
  8. added this to the milestone on Dec 12, 2018
  9. randolfo75 commented on Jan 18, 2019

    @randolfo75

    Same here:
    SM A520F • 5210ff6a5aeeb30f • android-arm64 • Android 8.0.0 (API 26) (emulator)
    It is a device though.

  10. Miiite commented on Jan 25, 2019

    @Miiite

    Same thing with a samsung A8. Seems like all samsungs are detected as emulators ?:

    SM A530F • 5200fdb0b4db854d • android-arm64 • Android 8.0.0 (API 26) (emulator)

    I also have a Sony Xperia Z5 compact, and I have no issues with this one.

  11. zoechi commented on Jan 25, 2019

    @zoechi
    Contributor

    Don't forget to thumbs-up the initial issue to raise priority.

  12. allandaleho commented on Feb 19, 2019

    @allandaleho

    For a workaround, what I did is run flutter build apk and then flutter install.

    This should help in running the application in release mode for unsupported android device. (tested with 1 samsung device)

    Hope this helped!

  13. samuelhnrq commented on Mar 9, 2019

    @samuelhnrq

    I was simply going to add that my A8 (A530F) is also not being recognized but that have already been reported, and sincerely, is the current solution the best? Someone has to create a pull request to every new Samsung device?

  14. 11 remaining items

  15. added
    platform-androidAndroid applications specifically
    and removed
    c: crashStack traces logged to the console
    on Jan 24, 2020
  16. zanderso commented on Jan 24, 2020

    @zanderso
    Member

    @chunhtai Were there any PRs landed related to this issue, or any offline discussion about this that you can summarize here?

  17. zanderso commented on Jan 24, 2020

    @zanderso
    Member
  18. blasten commented on Jan 24, 2020

    @blasten

    I'm unable to repro this issue on master, so it's probably fixed. :)

  19. alex-myznikov commented on Jan 27, 2020

    @alex-myznikov

    @chunhtai I had to add 'samsungexynos7880': _HardwareType.physical to get my Samsung SM-A520F considered as a real device on SDK version 1.12.13+hotfix.5. Can you, please, add it to the whitelist?

  20. chunhtai commented on Jan 27, 2020

    @chunhtai
    Contributor

    There is no fix landed for this issue, and it is currently rely on manual change to whitelist each device that has this problem.

  21. darrylsepeda commented on Feb 21, 2020

    @darrylsepeda

    I developed using mac and debug it in ios simulator, but when I tried to build apk for android and I run flutter run --release I got the same error Release mode is not supported for emulators..
    The apk generated from flutter is in debug mode, so I couldn't test it via play store.

    Have checked to other issues as well related to this --release command, seems no solution at all.

    I also tried this, but it doesn't work.

    The look up is from the build.prop in system folder. For some reason some phones have
    ro.build.characteristics = emulator.

    If you have this issue, can you check if the phone has this property in build.prop file?

    We have a whitelist

    const Map<String, _HardwareType> _knownHardware = <String, _HardwareType>{

    which is not ideal, but I can't think of anyway around it
    As for workaround, you can add your ro.hardware value from build.prop into whitelist and

    rm -rf bin/cache
    

    in flutter folder to clean the cache, and flutter run --release should work.

    In the same time, please provide the ro.hardware value here so i can add them to the whitelist permanently

    I put 'iPhone 11 Pro Max': _HardwareType.physical,, eventhough I know this should be for android and what I want to build is apk. This is really annoying!

  22. darrylsepeda commented on Feb 21, 2020

    @darrylsepeda

    Is it because I have another devices (web mode is on)?

    [✓] Flutter (Channel beta, v1.14.6, on Mac OS X 10.15.3 19D76, locale en-GB)
        • Flutter version 1.14.6 at /Applications/flutter
        • Framework revision fabeb2a16f (3 weeks ago), 2020-01-28 07:56:51 -0800
        • Engine revision c4229bfbba
        • Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
        • Android SDK at /Users/x/Library/Android/sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • 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_202-release-1483-b49-5587405)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 11.3.1, Build version 11C504
        • CocoaPods version 1.8.4
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 3.5)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 43.0.1
        • Dart plugin version 191.8593
        • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    
    [✓] VS Code (version 1.42.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.8.1
    
    [✓] Connected device (3 available)
        • iPhone 11 Pro Max • DF70D05D-DE88-4A4A-97C0-4F6526E380F5 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
        • Chrome            • chrome                               • web-javascript • Google Chrome 80.0.3987.116
        • Web Server        • web-server                           • web-javascript • Flutter Tools
    
    • No issues found!
    
  23. zanderso commented on Feb 24, 2020

    @zanderso
    Member

    @chunhtai If you think this issue needs more thought/work, could you re-open it and give it a better title? Thanks!

  24. chris097 commented on Mar 17, 2020

    @chris097

    Launching lib\main.dart on sdk gphone x86 in debug mode...
    Running Gradle task 'assembleDebug'...
    Exception in thread "main" java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.(ZipFile.java:225)
    at java.util.zip.ZipFile.(ZipFile.java:155)
    at java.util.zip.ZipFile.(ZipFile.java:169)
    at org.gradle.wrapper.Install.unzip(Install.java:214)
    at org.gradle.wrapper.Install.access$600(Install.java:27)
    at org.gradle.wrapper.Install$1.call(Install.java:74)
    at org.gradle.wrapper.Install$1.call(Install.java:48)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
    at org.gradle.wrapper.Install.createDist(Install.java:48)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
    [!] Gradle threw an error while trying to update itself. Retrying the update...
    Running Gradle task 'assembleDebug'...
    Exception in thread "main" java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.(ZipFile.java:225)
    at java.util.zip.ZipFile.(ZipFile.java:155)
    at java.util.zip.ZipFile.(ZipFile.java:169)
    at org.gradle.wrapper.Install.unzip(Install.java:214)
    at org.gradle.wrapper.Install.access$600(Install.java:27)
    at org.gradle.wrapper.Install$1.call(Install.java:74)
    at org.gradle.wrapper.Install$1.call(Install.java:48)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
    at org.gradle.wrapper.Install.createDist(Install.java:48)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
    [!] Gradle threw an error while trying to update itself. Retrying the update...
    Finished with error: Gradle task assembleDebug failed with exit code 1

  25. chris097 commented on Mar 17, 2020

    @chris097

    This issue is killing me how do solve this....

    Launching lib\main.dart on sdk gphone x86 in debug mode...
    Running Gradle task 'assembleDebug'...
    Exception in thread "main" java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.(ZipFile.java:225)
    at java.util.zip.ZipFile.(ZipFile.java:155)
    at java.util.zip.ZipFile.(ZipFile.java:169)
    at org.gradle.wrapper.Install.unzip(Install.java:214)
    at org.gradle.wrapper.Install.access$600(Install.java:27)
    at org.gradle.wrapper.Install$1.call(Install.java:74)
    at org.gradle.wrapper.Install$1.call(Install.java:48)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
    at org.gradle.wrapper.Install.createDist(Install.java:48)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
    [!] Gradle threw an error while trying to update itself. Retrying the update...
    Running Gradle task 'assembleDebug'...
    Exception in thread "main" java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.(ZipFile.java:225)
    at java.util.zip.ZipFile.(ZipFile.java:155)
    at java.util.zip.ZipFile.(ZipFile.java:169)
    at org.gradle.wrapper.Install.unzip(Install.java:214)
    at org.gradle.wrapper.Install.access$600(Install.java:27)
    at org.gradle.wrapper.Install$1.call(Install.java:74)
    at org.gradle.wrapper.Install$1.call(Install.java:48)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
    at org.gradle.wrapper.Install.createDist(Install.java:48)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
    [!] Gradle threw an error while trying to update itself. Retrying the update...
    Finished with error: Gradle task assembleDebug failed with exit code 1

  26. lock commented on Apr 19, 2020

    @lock

    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 flutter doctor -v and a minimal reproduction of the issue.

  27. locked and limited conversation to collaborators on Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

e: device-specificOnly manifests on certain devicesengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions