0

Upgraded my flutter to V2, tried to get the default app running on my Android device! no luck!

What I've done up to now:

  1. switched from Beta channel to stable
  2. ran flutter upgrade again
  3. got flutter doctor [all was fine]
  4. tried to run [failed, many times]
  5. tried flutter clean
  6. cleared the gradle cache, no luck
  7. tried to build again, it failed

============================ here is flutter doctor -v

flutter doctor -v
[√] Flutter (Channel stable, 2.0.3, on Microsoft Windows [Version 10.0.19042.867], locale en-US)
• Flutter version 2.0.3 at C:\Flutter\flutter
• Framework revision 4d7946a (2 weeks ago), 2021-03-18 17:24:33 -0700
• Engine revision 3459eb2436
• Dart version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at C:\Android\SDK
• Platform android-30, build-tools 30.0.0
• ANDROID_HOME = C:\Android\SDK
• Java binary at: C:\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 3.4)
• Android Studio at C:\Android\Android Studio
• Flutter plugin installed
• Dart plugin installed
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] VS Code (version 1.55.0)
• VS Code at C:\Users\DoohraF\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.21.0

[√] Connected device (3 available)
• SM N950F (mobile) • 988ad03647464f584730 • android-arm64 • Android 9 (API 28)
• Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.114
• Edge (web) • edge • web-javascript • Microsoft Edge 89.0.774.57

• No issues found!

================================= here is flutter run -v

flutter run -v
[ +125 ms] executing: [C:\Flutter\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +109 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +1 ms] 4d7946a
[ +1 ms] executing: [C:\Flutter\flutter/] git tag --points-at 4d7946a
[ +109 ms] Exit code 0 from: git tag --points-at 4d7946a
[ +1 ms] 2.0.3
[ +64 ms] executing: [C:\Flutter\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +69 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ +1 ms] origin/stable
[ ] executing: [C:\Flutter\flutter/] git ls-remote --get-url origin
[ +61 ms] Exit code 0 from: git ls-remote --get-url origin
[ +1 ms] https://github.com/flutter/flutter.git
[ +128 ms] executing: [C:\Flutter\flutter/] git rev-parse --abbrev-ref HEAD
[ +70 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +1 ms] stable
[ +103 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +6 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +131 ms] executing: C:\Android\SDK\platform-tools\adb.exe devices -l
[ +82 ms] List of devices attached
988ad03647464f584730 device product:greatltexx model:SM_N950F device:greatlte transport_id:2
[ +8 ms] C:\Android\SDK\platform-tools\adb.exe -s 988ad03647464f584730 shell getprop
[ +149 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +13 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ +3 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ +2 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +140 ms] Skipping pub get: version match.
[ +192 ms] Generating C:\testApp\application_one\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +109 ms] ro.hardware = samsungexynos8895
[ +74 ms] Initializing file store
[ +24 ms] Skipping target: gen_localizations
[ +27 ms] complete
[ +15 ms] Launching lib\main.dart on SM N950F in debug mode...
[ +15 ms] C:\Flutter\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev C:\Flutter\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
C:\Flutter\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names --experimental-emit-debug-metadata --output-dill
C:\Users\DoohraF\AppData\Local\Temp\flutter_tools.3a3a5250\flutter_tool.fa6cfafd\app.dill --packages C:\testApp\application_one.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false--enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build\cache.dill.track.dill
[ +60 ms] executing: C:\Android\SDK\platform-tools\adb.exe -s 988ad03647464f584730 shell -x logcat -v time -t 1
[ +31 ms] <- compile package:application_one/main.dart
[ +176 ms] --------- beginning of main
04-02 12:42:43.997 I/StackScroller( 4493): ADJUST STACK.TRANSLATION
[ +31 ms] executing: C:\Android\SDK\platform-tools\adb.exe version
[ +71 ms] Android Debug Bridge version 1.0.41
Version 30.0.3-6597393
Installed as C:\Android\SDK\platform-tools\adb.exe
[ +11 ms] executing: C:\Android\SDK\platform-tools\adb.exe start-server
[ +83 ms] Building APK
[ +51 ms] Running Gradle task 'assembleDebug'...
[ +38 ms] Using gradle from C:\testApp\application_one\android\gradlew.bat.
[ +8 ms] C:\testApp\application_one\android\gradlew.bat mode: 33279 rwxrwxrwx.
[ +42 ms] executing: C:\Android\Android Studio\jre\bin\java -version
[ +168 ms] Exit code 0 from: C:\Android\Android Studio\jre\bin\java -version
[ +1 ms] openjdk version "1.8.0_152-release"
OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
OpenJDK 64-Bit Server VM (build 25.152-b01, mixed mode)
[ +8 ms] executing: [C:\testApp\application_one\android/] C:\testApp\application_one\android\gradlew.bat -Pverbose=true -Ptarget-platform=android-arm64 -Ptarget=C:\testApp\application_one\lib\main.dart
-Ptrack-widget-creation=true -Pfilesystem-scheme=org-dartlang-root assembleDebug
[+11720 ms] > Task :app:compileFlutterBuildDebug
[ +41 ms] [ +108 ms] executing: [C:\Flutter\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +127 ms] [ +177 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +3 ms] [ +1 ms] 4d7946a
[ +3 ms] [ +3 ms] executing: [C:\Flutter\flutter/] git tag --points-at 4d7946a
[ +301 ms] [ +289 ms] Exit code 0 from: git tag --points-at 4d7946a
[ +37 ms] [ ] 2.0.3
[ +11 ms] [ +73 ms] executing: [C:\Flutter\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +146 ms] [ +221 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ +4 ms] [ ] origin/stable
[ +36 ms] [ ] executing: [C:\Flutter\flutter/] git ls-remote --get-url origin
[ +153 ms] [ +112 ms] Exit code 0 from: git ls-remote --get-url origin
[ +2 ms] [ ] https://github.com/flutter/flutter.git
[ +111 ms] [ +148 ms] executing: [C:\Flutter\flutter/] git rev-parse --abbrev-ref HEAD
[ +104 ms] [ +111 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +3 ms] [ ] stable
[ +94 ms] [ +92 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ +42 ms] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ +3 ms] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +4 ms] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +9 ms] [ +26 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ +2 ms] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ +6 ms] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ +2 ms] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ +2 ms] [ +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ +3 ms] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ +20 ms] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +197 ms] [ +218 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[ +2 ms] [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[ +5 ms] [ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ +1 ms] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ +1 ms] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +15 ms] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +5 ms] [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ +4 ms] [ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ +5 ms] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ +3 ms] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ +4 ms] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ +1 ms] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ +7 ms] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ +3 ms] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +3 ms] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ +3 ms] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ +1 ms] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ +10 ms] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ +3 ms] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ +2 ms] [ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ +12 ms] [ ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ +16 ms] [ +118 ms] Initializing file store
[ +80 ms] [ +71 ms] Skipping target: gen_localizations
[ +5 ms] [ +51 ms] kernel_snapshot: Starting due to {}
[ +2 ms] [ +33 ms] C:\Flutter\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev C:\Flutter\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
C:\Flutter\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --target=flutter --no-print-incremental-dependencies -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts
--track-widget-creation --no-link-platform --packages C:\testApp\application_one.dart_tool\package_config.json --output-dill
C:\testApp\application_one.dart_tool\flutter_build\71f37d3e35a7c016bab59604674cf884\app.dill --depfile C:\testApp\application_one.dart_tool\flutter_build\71f37d3e35a7c016bab59604674cf884\kernel_snapshot.dpackage:application_one/main.dart
[+14585 ms] [+14585 ms] kernel_snapshot: Complete
[+1504 ms] [+1435 ms] debug_android_application: Starting due to {}
[+1005 ms] [+1078 ms] debug_android_application: Complete
[ +796 ms] [ +721 ms] Persisting file store
[ +1 ms] [ +26 ms] Done persisting file store
[ +1 ms] [ +17 ms] build succeeded.
[ +1 ms] [ +24 ms] "flutter assemble" took 18,460ms.
[ +1 ms] [ +3 ms] ensureAnalyticsSent: 0ms
[ +1 ms] [ +1 ms] Running shutdown hooks
[ +1 ms] [ ] Shutdown hooks complete
[ +2 ms] [ ] exiting with code 0
[ +382 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[ +1 ms] > Task :app:preBuild UP-TO-DATE
[ +1 ms] > Task :app:preDebugBuild UP-TO-DATE
[ +1 ms] > Task :app:compileDebugAidl NO-SOURCE
[ +2 ms] > Task :app:compileDebugRenderscript NO-SOURCE
[ +3 ms] > Task :app:generateDebugBuildConfig UP-TO-DATE
[ +395 ms] > Task :app:checkDebugAarMetadata UP-TO-DATE
[ +5 ms] > Task :app:cleanMergeDebugAssets
[ +2 ms] > Task :app:mergeDebugShaders UP-TO-DATE
[ +1 ms] > Task :app:compileDebugShaders NO-SOURCE
[ +1 ms] > Task :app:generateDebugAssets UP-TO-DATE
[ +82 ms] > Task :app:mergeDebugAssets
[+1007 ms] > Task :app:copyFlutterAssetsDebug
[ +3 ms] > Task :app:generateDebugResValues UP-TO-DATE
[ +5 ms] > Task :app:generateDebugResources UP-TO-DATE
[ +31 ms] > Task :app:mergeDebugResources UP-TO-DATE
[ +4 ms] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[ +2 ms] > Task :app:extractDeepLinksDebug UP-TO-DATE
[ +80 ms] > Task :app:processDebugMainManifest UP-TO-DATE
[ +1 ms] > Task :app:processDebugManifest UP-TO-DATE
[ +31 ms] > Task :app:processDebugManifestForPackage UP-TO-DATE
[ +127 ms] > Task :app:processDebugResources UP-TO-DATE
[ +110 ms] > Task :app:compileDebugKotlin UP-TO-DATE
[ +2 ms] > Task :app:javaPreCompileDebug UP-TO-DATE
[ +2 ms] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[ +2 ms] > Task :app:compileDebugSources UP-TO-DATE
[ +1 ms] > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
[ +1 ms] > Task :app:compressDebugAssets UP-TO-DATE
[ +1 ms] > Task :app:processDebugJavaRes NO-SOURCE
[ +83 ms] > Task :app:mergeDebugJavaResource UP-TO-DATE
[ +117 ms] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[ +1 ms] > Task :app:dexBuilderDebug UP-TO-DATE
[ +9 ms] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[ +75 ms] > Task :app:mergeExtDexDebug UP-TO-DATE
[ +1 ms] > Task :app:mergeDexDebug UP-TO-DATE
[ +1 ms] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[ +90 ms] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[ +2 ms] > Task :app:stripDebugDebugSymbols UP-TO-DATE
[ +1 ms] > Task :app:validateSigningDebug UP-TO-DATE
[+3313 ms] > Task :app:packageDebug FAILED
[ +15 ms] FAILURE: Build failed with an exception.
[ +6 ms] * What went wrong:
[ +24 ms] Execution failed for task ':app:packageDebug'.
[ +4 ms] > A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
[ +1 ms] > java.io.IOException: Failed to generate v1 signature
[ +1 ms] * Try:
[ +1 ms] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[ +4 ms] * Get more help at https://help.gradle.org
[ +4 ms] BUILD FAILED in 37s
[ +4 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[ +1 ms] Use '--warning-mode all' to show the individual deprecation warnings.
[ +8 ms] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[ +3 ms] 31 actionable tasks: 5 executed, 26 up-to-date
[+2198 ms] Running Gradle task 'assembleDebug'... (completed in 39.7s)
[ +47 ms] Exception: Gradle task assembleDebug failed with exit code 1
[ +6 ms] "flutter run" took 41,469ms.
[ +9 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:644:9)

#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)

#3 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1009:27)

#4 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)

#5 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)

#6 CommandRunner.runCommand (package:args/command_runner.dart:197:13)

#7 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)

#8 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)

#9 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)

#10 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)

#11 run.. (package:flutter_tools/runner.dart:64:9)

#12 run. (package:flutter_tools/runner.dart:62:12)

#13 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)

#14 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)

#15 runInContext (package:flutter_tools/src/context_runner.dart:73:10)

#16 main (package:flutter_tools/executable.dart:90:3)
[ +162 ms] ensureAnalyticsSent: 151ms
[ +10 ms] Running shutdown hooks
[ +11 ms] Shutdown hook priority 4
[ +26 ms] Shutdown hooks complete
[ +2 ms] exiting with code 1

this is the App level build.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 30

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.the_baby_shopping_list"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

I would appreciate any help, this is taking so much of my time already.

DoohraF
  • 3
  • 5

1 Answers1

1

Could you try to

  • Quit you IDE
  • Move or remove the ~/.android/debug.keystore and ~/.android/debug.keystore.lock file
  • Use the flutter clean method
  • Recompile your app
FDuhen
  • 4,097
  • 1
  • 15
  • 26
  • Man, thank you! it worked. my appreciation. – DoohraF Apr 02 '21 at 22:44
  • Any help for me. Looking for similar problem with flutter web version fails after 2.0 upgrade. Question posted with the following link. https://stackoverflow.com/questions/67000431/flutter-2-0-web-version-with-firebase-messaging-is-not-working?noredirect=1#comment118431297_67000431 – Raghu Mudem Apr 08 '21 at 09:34