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

Intermittent no certificates installation failure #8605

Closed
rbishop-bah opened this issue Mar 7, 2017 · 36 comments
Closed

Intermittent no certificates installation failure #8605

rbishop-bah opened this issue Mar 7, 2017 · 36 comments
Labels
platform-android Android applications specifically platform-windows Building on or for Windows specifically t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@rbishop-bah
Copy link

rbishop-bah commented Mar 7, 2017

Steps to Reproduce

Attempt to run from Android Studio on Windows 10. Sometimes the following dialog appears:

image

Workaround: Cancelling the dialog and trying again eventually resolves the problem.

@goderbauer requested that I file this issue.

Logs

$ adb install-multiple -r ...\android\app\build\intermediates\split-apk\debug\slices\slice_4.apk ...\android\app\build\intermediates\split-apk\debug\slices\slice_3.apk ...\android\app\build\intermediates\split-apk\debug\slices\slice_9.apk ...\android\app\build\intermediates\split-apk\debug\slices\slice_5.apk ...\android\app\build\intermediates\split-apk\debug\slices\slice_8.apk ...\android\app\build\intermediates\split-apk\debug\slices\slice_7.apk ...\android\app\build\intermediates\split-apk\debug\slices\slice_6.apk ...\android\app\build\intermediates\split-apk\debug\dep\dependencies.apk ...\android\app\build\intermediates\split-apk\debug\slices\slice_1.apk ...\android\app\build\intermediates\split-apk\debug\slices\slice_2.apk ...\android\app\build\intermediates\split-apk\debug\slices\slice_0.apk ...\android\app\build\outputs\apk\app-debug.apk 
Error while Installing APKs

Flutter Doctor

[√] Flutter (on Windows, channel master)
    • Flutter at C:\dev\flutter
    • Framework revision ca0201d8ae (3 days ago),
    • Engine revision 342a31136e
    • Tools Dart version 1.23.0-dev.2.0

[√] Android toolchain - develop for Android devices (Android SDK 25.0.2)
    • Android SDK at C:\Users\Rob\AppData\Local\Android\sdk
    • Platform android-25, build-tools 25.0.2
    • Java(TM) SE Runtime Environment (build 1.8.0_121-b13)

[√] Android Studio (version 2.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Gradle version 3.2

[√] IntelliJ IDEA Community Edition (version 2016.3)
    • Dart plugin version 163.13137
    • Flutter plugin version 0.1.11.1

[√] Connected devices
    • 2PS64 • HT69N0100346 • android-arm • Android 7.0 (API 24)
@eseidelGoogle
Copy link
Contributor

Odd. @jakobr-google or @goderbauer might have thoughts.

Thanks for the report!

@eseidelGoogle eseidelGoogle added platform-android Android applications specifically platform-windows Building on or for Windows specifically t: gradle "flutter build" and "flutter run" on Android labels Mar 27, 2017
@eseidelGoogle eseidelGoogle added this to the 3: Make conferences happy milestone Mar 27, 2017
@goderbauer
Copy link
Member

Unfortunately, I've never seen this locally.

@rbishop-bah Do you still see this in the latest version of Flutter? Flutter has changed a bit since this was filed...

@rbishop-bah
Copy link
Author

I have seen it yes as late as last week. Haven't used flutter in about five days so can't comment on the very latest.

@rbishop-bah
Copy link
Author

rbishop-bah commented Apr 1, 2017

Seen again today 4/1.

[√] Flutter (on Microsoft Windows [Version 10.0.14393], channel master)
    • Flutter at C:\dev\flutter
    • Framework revision 91dbb3c91e (16 hours ago),
    • Engine revision 4c05830aaf
    • Tools Dart version 1.23.0-dev.10.0

[√] Host Executable Compatibility
    • Downloaded executables execute on host

[√] Android toolchain - develop for Android devices (Android SDK 25.0.2)
    • Android SDK at C:\Users\Rob\AppData\Local\Android\sdk
    • Platform android-25, build-tools 25.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version: OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

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

[√] IntelliJ IDEA Community Edition (version 2017.1)
    • Dart plugin version 171.4006
    • Flutter plugin version 12.0

[√] Connected devices
    • 2PS64 • HT69N0100346 • android-arm • Android 7.0 (API 24)

@goderbauer
Copy link
Member

goderbauer commented Apr 27, 2017

@Skylled reported the same issue in #9638:

[        ] C:\Android\sdk\platform-tools\adb -s LGH9107a67a5fd install -r build\app/outputs/apk/app.apk
[+1362 ms] Failed to install build\app/outputs/apk/app.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl703449352.tmp/base.apk using APK Signature Scheme v2: SHA-256 digest of contents did not verify]

@Skylled
Copy link
Contributor

Skylled commented Apr 27, 2017

Just to confirm, @rbishop-bah is on Windows 10 and I'm encountering the issue on Windows 8.1, so it's not a Windows 10 specific issue, nor is it an Android Studio specific issue.

@goderbauer
Copy link
Member

Turns out we already had retry logic for when adb fails. However, due to a bug it wasn't triggered. I fixed that. Can you please update your flutter checkout and see if the problem persists? Thanks!

@rbishop-bah
Copy link
Author

@goderbauer Will do.

@rbishop-bah
Copy link
Author

Saw the dialog again after updating, but it resolved itself so I guess the retry logic is working. @goderbauer

@Skylled
Copy link
Contributor

Skylled commented May 5, 2017

So the retry logic definitely works when doing a reinstall, but the error still occurs on a fresh install.

PS C:\Users\Kyle\Source\Flutter\Cybertronix> flutter run -v
[  +34 ms] [C:\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[  +65 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/master
[        ] [C:\flutter\] git ls-remote --get-url origin
[  +39 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[        ] [C:\flutter\] git log -n 1 --pretty=format:%H
[  +42 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[        ] 5a9b5251469d776b81e494856d609f6754d6f3b5
[        ] [C:\flutter\] git log -n 1 --pretty=format:%ar
[  +40 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[        ] 5 hours ago
[ +384 ms] Listing devices using C:\Android\sdk\platform-tools\adb
[   +2 ms] C:\Android\sdk\platform-tools\adb devices -l
[  +14 ms] Exit code 0 from: C:\Android\sdk\platform-tools\adb devices -l
[        ] List of devices attached
           LGH9107a67a5fd         device product:elsa_att_us model:LG_H910 device:elsa
[  +22 ms] C:\Android\sdk\platform-tools\adb -s LGH9107a67a5fd shell getprop
[ +872 ms] Launching lib/main.dart on LG H910 in debug mode...
[ +149 ms] Using gradle from C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle.bat.
[   +2 ms] [android\] C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle.bat app:properties
[+2135 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle.bat app:properties
[  +51 ms] C:\Android\sdk\platform-tools\adb -s LGH9107a67a5fd logcat -v time -t 1
[ +192 ms] Exit code 0 from: C:\Android\sdk\platform-tools\adb -s LGH9107a67a5fd logcat -v time -t 1
[        ] --------- beginning of main
           05-05 18:33:43.425 D/sensors_hal_Util( 1554): waitForResponse: timeout=0
[   +2 ms] C:\Android\sdk\platform-tools\adb -s LGH9107a67a5fd logcat -v time
[   +8 ms] C:\Android\sdk\platform-tools\adb version
[  +28 ms] Android Debug Bridge version 1.0.39
           Revision 3db08f2c6889-android
           Installed as C:\Android\sdk\platform-tools\adb.EXE
[   +4 ms] C:\Android\sdk\platform-tools\adb start-server
[  +22 ms] Building APK
[ +105 ms] Found plugin url_launcher at C:\Users\Kyle\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\url_launcher-0.2.0\
[  +29 ms] Using gradle from C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle.bat.
[   +4 ms] Running 'gradle assembleDebug'...
[   +2 ms] [android\] C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle.bat -Ptarget=C:\Users\Kyle\Source\Flutt
er\Cybertronix\lib/main.dart assembleDebug
[+2726 ms] Incremental java compilation is an incubating feature.
[  +11 ms] The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskI
nputs.file(Object).skipWhenEmpty() instead.
[        ]      at build_bhixzqu22wz2op93jnb3b0cud$_run_closure2.doCall(C:\Users\Kyle\Source\Flutter\Cybertronix\android\build.gra
dle:20)
[+3242 ms] :app:flutterBuildX86Jar
[   +1 ms] :app:preBuild UP-TO-DATE
[   +2 ms] :app:preDebugBuild UP-TO-DATE
[   +3 ms] :app:checkDebugManifest
[        ] :app:preProfileBuild UP-TO-DATE
[   +2 ms] :app:preReleaseBuild UP-TO-DATE
[   +1 ms] :url_launcher:preBuild UP-TO-DATE
[        ] :url_launcher:preReleaseBuild UP-TO-DATE
[   +2 ms] :url_launcher:checkReleaseManifest
[   +1 ms] :url_launcher:prepareReleaseDependencies
[   +4 ms] :url_launcher:compileReleaseAidl UP-TO-DATE
[   +2 ms] :url_launcher:compileReleaseNdk UP-TO-DATE
[   +2 ms] :url_launcher:compileLint UP-TO-DATE
[   +2 ms] :url_launcher:copyReleaseLint UP-TO-DATE
[   +3 ms] :url_launcher:mergeReleaseShaders UP-TO-DATE
[   +3 ms] :url_launcher:compileReleaseShaders UP-TO-DATE
[   +1 ms] :url_launcher:generateReleaseAssets UP-TO-DATE
[   +3 ms] :url_launcher:mergeReleaseAssets UP-TO-DATE
[   +6 ms] :url_launcher:mergeReleaseProguardFiles UP-TO-DATE
[   +8 ms] :url_launcher:packageReleaseRenderscript UP-TO-DATE
[   +7 ms] :url_launcher:compileReleaseRenderscript UP-TO-DATE
[   +3 ms] :url_launcher:generateReleaseResValues UP-TO-DATE
[        ] :url_launcher:generateReleaseResources UP-TO-DATE
[   +4 ms] :url_launcher:packageReleaseResources UP-TO-DATE
[   +4 ms] :url_launcher:processReleaseManifest UP-TO-DATE
[   +5 ms] :url_launcher:generateReleaseBuildConfig UP-TO-DATE
[   +7 ms] :url_launcher:processReleaseResources UP-TO-DATE
[        ] :url_launcher:generateReleaseSources UP-TO-DATE
[   +7 ms] :url_launcher:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
[  +14 ms] :url_launcher:compileReleaseJavaWithJavac UP-TO-DATE
[   +1 ms] :url_launcher:processReleaseJavaRes UP-TO-DATE
[   +2 ms] :url_launcher:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
[   +4 ms] :url_launcher:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
[  +13 ms] :url_launcher:mergeReleaseJniLibFolders UP-TO-DATE
[   +5 ms] :url_launcher:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
[   +2 ms] :url_launcher:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
[   +5 ms] :url_launcher:bundleRelease UP-TO-DATE
[ +133 ms] :app:prepareIoFlutterPluginsUrl_launcherUrl_launcher10SNAPSHOTLibrary
[   +1 ms] :app:prepareDebugDependencies
[  +22 ms] :app:compileDebugAidl
[  +16 ms] :app:compileDebugRenderscript
[  +35 ms] :app:generateDebugBuildConfig
[   +1 ms] :app:flutterDependenciesDebug UP-TO-DATE
[+9714 ms] :app:flutterBuildDebug
[  +15 ms] :app:mergeDebugShaders
[   +6 ms] :app:compileDebugShaders
[  +15 ms] :app:generateDebugAssets
[   +1 ms] :app:mergeDebugAssets
[  +27 ms] :app:copyFlutterAssetsDebug
[   +7 ms] :app:generateDebugResValues
[        ] :app:generateDebugResources
[ +241 ms] :app:mergeDebugResources
[ +100 ms] :app:processDebugManifest
[ +195 ms] :app:processDebugResources
[        ] :app:generateDebugSources
[   +9 ms] :app:incrementalDebugJavaCompilationSafeguard
[  +46 ms] :app:compileDebugJavaWithJavac
[        ] :app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
[+1197 ms] :app:compileDebugNdk UP-TO-DATE
[   +3 ms] :app:compileDebugSources
[+3136 ms] :app:transformClassesWithDexForDebug
[  +11 ms] :app:mergeDebugJniLibFolders
[+4939 ms] :app:transformNative_libsWithMergeJniLibsForDebug
[   +3 ms] :app:processDebugJavaRes UP-TO-DATE
[ +671 ms] :app:transformResourcesWithMergeJavaResForDebug
[   +3 ms] :app:validateSigningDebug
[+1670 ms] :app:packageDebug
[   +1 ms] :app:assembleDebug
[        ] :url_launcher:preDebugBuild UP-TO-DATE
[   +1 ms] :url_launcher:checkDebugManifest
[        ] :url_launcher:prepareDebugDependencies
[   +4 ms] :url_launcher:compileDebugAidl UP-TO-DATE
[   +4 ms] :url_launcher:compileDebugNdk UP-TO-DATE
[   +1 ms] :url_launcher:copyDebugLint UP-TO-DATE
[   +3 ms] :url_launcher:mergeDebugShaders UP-TO-DATE
[   +2 ms] :url_launcher:compileDebugShaders UP-TO-DATE
[        ] :url_launcher:generateDebugAssets UP-TO-DATE
[   +4 ms] :url_launcher:mergeDebugAssets UP-TO-DATE
[   +2 ms] :url_launcher:mergeDebugProguardFiles UP-TO-DATE
[   +3 ms] :url_launcher:packageDebugRenderscript UP-TO-DATE
[   +5 ms] :url_launcher:compileDebugRenderscript UP-TO-DATE
[   +2 ms] :url_launcher:generateDebugResValues UP-TO-DATE
[   +2 ms] :url_launcher:generateDebugResources UP-TO-DATE
[   +5 ms] :url_launcher:packageDebugResources UP-TO-DATE
[   +4 ms] :url_launcher:processDebugManifest UP-TO-DATE
[   +8 ms] :url_launcher:generateDebugBuildConfig UP-TO-DATE
[  +12 ms] :url_launcher:processDebugResources UP-TO-DATE
[   +4 ms] :url_launcher:generateDebugSources UP-TO-DATE
[   +3 ms] :url_launcher:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
[   +9 ms] :url_launcher:compileDebugJavaWithJavac UP-TO-DATE
[   +4 ms] :url_launcher:processDebugJavaRes UP-TO-DATE
[   +3 ms] :url_launcher:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
[  +15 ms] :url_launcher:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
[   +1 ms] :url_launcher:mergeDebugJniLibFolders UP-TO-DATE
[   +3 ms] :url_launcher:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
[   +8 ms] :url_launcher:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
[   +3 ms] :url_launcher:bundleDebug UP-TO-DATE
[        ] :url_launcher:compileDebugSources UP-TO-DATE
[        ] :url_launcher:assembleDebug UP-TO-DATE
[        ] BUILD SUCCESSFUL
[        ] Total time: 28.315 secs
[ +515 ms] calculateSha: build\app/outputs/apk/app.apk
[ +469 ms] Built build\app/outputs/apk/app-debug.apk (21.6MB).
[   +2 ms] C:\Android\sdk\build-tools\25.0.3\aapt dump badging build\app/outputs/apk/app.apk
[  +11 ms] Exit code 0 from: C:\Android\sdk\build-tools\25.0.3\aapt dump badging build\app/outputs/apk/app.apk
[        ] package: name='com.yourcompany.Cybertronix' versionCode='1' versionName='0.0.1' platformBuildVersionName='7.1.1'
           sdkVersion:'16'
           targetSdkVersion:'21'
           uses-permission: name='android.permission.INTERNET'
           application-icon-160:'res/mipmap-mdpi-v4/ic_launcher.png'
           application-icon-240:'res/mipmap-hdpi-v4/ic_launcher.png'
           application-icon-320:'res/mipmap-xhdpi-v4/ic_launcher.png'
           application-icon-480:'res/mipmap-xxhdpi-v4/ic_launcher.png'
           application-icon-640:'res/mipmap-xxxhdpi-v4/ic_launcher.png'
           application: label='' icon='res/mipmap-mdpi-v4/ic_launcher.png'
           application-debuggable
           launchable-activity: name='com.yourcompany.Cybertronix.MainActivity'  label='' icon=''
           feature-group: label=''
             uses-feature: name='android.hardware.faketouch'
             uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps'
           main
           supports-screens: 'small' 'normal' 'large' 'xlarge'
           supports-any-density: 'true'
           locales:
           densities: '160' '240' '320' '480' '640'
           native-code: 'armeabi-v7a' 'x86' 'x86_64'
[   +1 ms] Stopping app 'app.apk' on LG H910.
[        ] C:\Android\sdk\platform-tools\adb -s LGH9107a67a5fd shell am force-stop com.yourcompany.Cybertronix
[+1016 ms] C:\Android\sdk\platform-tools\adb -s LGH9107a67a5fd shell pm list packages com.yourcompany.Cybertronix
[ +481 ms] Installing APK.
[   +1 ms] C:\Android\sdk\platform-tools\adb version
[  +14 ms] Android Debug Bridge version 1.0.39
           Revision 3db08f2c6889-android
           Installed as C:\Android\sdk\platform-tools\adb.EXE
[        ] C:\Android\sdk\platform-tools\adb start-server
[  +14 ms] Installing build\app/outputs/apk/app.apk...
[        ] C:\Android\sdk\platform-tools\adb -s LGH9107a67a5fd install -r build\app/outputs/apk/app.apk
[+1193 ms] Failed to install build\app/outputs/apk/app.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certi
ficates from /data/app/vmdl1223641424.tmp/base.apk using APK Signature Scheme v2: SHA-256 digest of contents did not verify]
[   +1 ms] Error: ADB exited with exit code 1
[   +1 ms] Warning: Failed to install APK.
[        ] Error launching application on LG H910.

#0      throwToolExit (package:flutter_tools/src/base/common.dart:29)
#1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:327)
<asynchronous suspension>
#2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:205)
<asynchronous suspension>
#3      RunCommand.verifyThenRunCommand (package:flutter_tools/src/commands/run.dart:210)
<asynchronous suspension>
#4      FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:156)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:194)
<asynchronous suspension>
#6      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:262)
<asynchronous suspension>
#7      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:109)
#8      Future.Future.sync (dart:async/future.dart:208)
#9      CommandRunner.run (package:args/command_runner.dart:109)
#10     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:157)
#11     run.<anonymous closure> (package:flutter_tools/executable.dart:140)
<asynchronous suspension>
#12     AppContext._run (package:flutter_tools/src/base/context.dart:76)
<asynchronous suspension>
#13     AppContext.runInZone.<anonymous closure> (package:flutter_tools/src/base/context.dart:66)
#14     _rootRun (dart:async/zone.dart:1120)
#15     _CustomZone.run (dart:async/zone.dart:1001)
#16     runZoned (dart:async/zone.dart:1465)
#17     AppContext.runInZone (package:flutter_tools/src/base/context.dart:65)
#18     run (package:flutter_tools/executable.dart:113)
<asynchronous suspension>
#19     main (package:flutter_tools/executable.dart:66)
<asynchronous suspension>
#20     main (file:///C:/flutter/packages/flutter_tools/bin/flutter_tools.dart:16)
#21     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:263)
#22     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)


[  +23 ms] ensureAnalyticsSent: 0ms
[   +1 ms] exiting with code 2

@rbishop-bah
Copy link
Author

This is happening a lot again after a flutter plugin update and an Android Studio update.

@goderbauer
Copy link
Member

I still can't reproduce this on any of my windows machines. Here are some shots in the dark to gather more information:

  1. Are you installing the app on your phone always from the same machine? Or are you switching between machines?
  2. Does your app have a unique application ID?
  3. Have you tried deleting the app from your phone entirely and running flutter build clean before installing the app again?
  4. What kind of virus scanner do you run on your system?

@Skylled
Copy link
Contributor

Skylled commented May 8, 2017

  1. Yes. I only have the one dev environment.
  2. Unique to my phone, but still a com.mycompany.<apphere>, and even then it's been independent of project. I've had the problem with the animated_list example from the Examples Catalog, in addition to my normal project.
  3. I was not aware of flutter build clean I'll use that every time from now on.
  4. No antivirus installed. Even Defender is disabled. Every AV I tried gave me troubles with development.

@goderbauer
Copy link
Member

I was not aware of flutter build clean I'll use that every time from now on.

I would not recommend to use it all the time. I am just wondering if there are any old leftover build artifacts that cause the problem you're experiencing. With flutter build clean we can throw those away once. However, it should not be part of your normal workflow.

@goderbauer
Copy link
Member

@rbishop-bah @Skylled What is the android device you're trying to install your app on? Do you have access to another android device? Do you experience the same problem with it?

@rbishop-bah
Copy link
Author

@goderbauer HTC 10... only one I have access to.
1 - same machine
2 - yes, a unique name for the app
3 - no
4 - Windows Defender

@goderbauer
Copy link
Member

Thanks for the information. I am wondering if this is a temporary issue with installing apps via adb or if flutter actually produces a damaged apk for some reason. Can you try the following: The next time you see the error, can you please try to re-install the produced apk (see command below)? Does that work? If not, would you be willing to provide me with the potentially damaged APK? I'd love to take a look at it.

@Skylled According to your log, the command to re-install should be for you (execute from the root directory of your app):

C:\Android\sdk\platform-tools\adb -s LGH9107a67a5fd install -r build\app/outputs/apk/app.apk

@rbishop-bah For you, the command to re-install should be (execute from the root directory of your app):

C:\Users\Rob\AppData\Local\Android\sdk\platform-tools\adb -s HT69N0100346 install -r build\app/outputs/apk/app.apk

@Skylled
Copy link
Contributor

Skylled commented May 10, 2017

Okay, got it to occur again. Immediately after the failed flutter run, I used adb install build/app/outputs/apk/app.apk
I skipped the -r and -s options, hope that doesn't affect anything. Either way, the install was successful.

I would think enabling the retry logic, regardless of whether the app was already installed once on the phone, would do the trick 99% of the time. But I understand that's only a stopgap measure, and that a root cause should be discovered for the long run.

I'll attach an APK next time I get this problem to happen, if you'd like to look over the certs.

@rbishop-bah
Copy link
Author

The command did not run but manually deleting the build folder from the android folder seemed to help.

goderbauer added a commit to goderbauer/flutter that referenced this issue May 11, 2017
@goderbauer
Copy link
Member

Our current hypothesis is that the apk is getting corrupted when transferred onto your device. Unfortunately, I don't know why this is happening and without having access to the device it's impossible to debug. It would be interesting to collect some more data points: Does the problem exist when you use a different USB port, a different USB cord, or a different Android device (maybe borrow one from a friend)?

You can also try to deploy your app with Android Studio instead of through Flutter: Open Android Studio, File > New > Import Project... (or if you see the "Welcome to Android Studio" dialog hit "Import Project" there) and within your Flutter project select android/build.gradle. In the "Gradle Sync" dialog hit OK (don't update Gradle if asked in the next dialog) and then use the green play button in the toolbar to deploy your app to your phone. Are you getting the same error? (try it multiple times, hit stop, change something in the app, hit play again, etc...)

@Skylled
Copy link
Contributor

Skylled commented May 18, 2017

A little quirk in my system might have revealed a source of the problem. I installed adb separately months ago and that version (32) is what's in my PATH, while Flutter uses the version (39) from my ANDROID_HOME. So when I retry an install, I'm using version 32 and it (seemingly) never fails.

Could it be that this is an issue with newer versions of adb for Windows?

@Hixie Hixie added the tool Affects the "flutter" command-line tool. See also t: labels. label May 23, 2017
@mit-mit
Copy link
Member

mit-mit commented Jun 19, 2017

Yes, that sounds very likely. Going to close this for now as environment related.

@mit-mit mit-mit closed this as completed Jun 19, 2017
@wilburx9
Copy link

@Skylled I am experiencing the same issue on Ubuntu 17.10 and HTC 10, please how did you fix this?

@Skylled
Copy link
Contributor

Skylled commented Mar 25, 2018

I've changed dev environments (Windows to Ubuntu), I've changed cables, I've updated everything I can think of and never solved it. Variables I haven't changed are my laptop itself and my phone. For now I just retry until it works. I don't think it's a Flutter related problem.

Only way flutter could help diagnose is if adb offered more info about why the install failed under a flag.

@aldeecura
Copy link

hi guys, just want to know what's the update on this issue, is this resolved?

@kaihaan-zz
Copy link

I've just had the same issue within Android Studio. Using the AVD manager to "Wipe Data" seems to have cleared it.

@tsathis
Copy link

tsathis commented May 14, 2019

I have had the same issue when installing to my physical device. But that was a simple 'stupid' mistake. My physical devices memory was full. Then I uninstalled some apps, and tried again, it worked well.

@FlutterForefront
Copy link

Select and unselect sdk platform tools in android studio

@devzsolt
Copy link

devzsolt commented Sep 6, 2019

I saw this error happening on an Android 9.0 device when somehow the app landed in Android's "Work mode" and it wasn't able to run properly and it was stuck instead without meaningful error messages (I saw the certificate error only once).
On this phone however ADB over network seems like working well. I believe it's an Android issue unrelated to Flutter but still annoying.

@ramioooz
Copy link

ramioooz commented Dec 7, 2019

  • uninstall your app,
  • disconnect your phone,
  • restart your android phone
  • restart your pc,
  • connect your phone to the pc,
  • build again.

Thank you

@heinzan
Copy link

heinzan commented Jan 9, 2021

Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install app.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /.../base.apk using APK Signature Scheme v2: SHA-256 digest of contents did not verify]

@purplecandy
Copy link

Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install app.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /.../base.apk using APK Signature Scheme v2: SHA-256 digest of contents did not verify]

facing the same issue a lot recently flutter clean does solves the issue but its getting too frequent and recompiling everything after flutter clean takes a lot of time

@budlight
Copy link

budlight commented Mar 7, 2021

Is it possible this bug is based on app size? I started getting this bug when my app size increased to 500mb. Maybe the signing process takes too long?

@yuqidesign
Copy link

Is it possible this bug is based on app size? I started getting this bug when my app size increased to 500mb. Maybe the signing process takes too long?

I have the same feeling. I could install a 20mb apk, but failed to install a 1gb apk. The packging and signing process is totally no difference.

@khairmuhammad
Copy link

same issue with me, did anyone found any solution....
Exception: Profile mode is not supported for sdk gphone x86 arm.
Exited (1)

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform-android Android applications specifically platform-windows Building on or for Windows specifically t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests