Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Gallery app fails to build on Android #558

Closed
maheshj01 opened this issue Nov 15, 2021 · 7 comments
Closed

Gallery app fails to build on Android #558

maheshj01 opened this issue Nov 15, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@maheshj01
Copy link
Member

Describe the bug
The gallery app fails to run on Android on the latest master/stable channel.

Flutter doctor

flutter doctor -v
✓] Flutter (Channel master, 2.6.0-12.0.pre.719, on macOS 12.0.1 21A559 darwin-arm, locale en-GB)
    • Flutter version 2.6.0-12.0.pre.719 at /Users/mahesh/Documents/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 34dbee66de (14 hours ago), 2021-11-14 18:46:02 -0500
    • Engine revision 140bd9399e
    • Dart version 2.16.0 (build 2.16.0-10.0.dev)
    • DevTools version 2.8.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 60.1.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.61.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.0.1 21A559 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 96.0.4664.45

• No issues found!
[✓] Flutter (Channel stable, 2.5.3, on macOS 12.0.1 21A559 darwin-arm, locale en-GB)
    • Flutter version 2.5.3 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (4 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.1, Build version 13A1030d
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 60.1.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.61.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.0.1 21A559 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 96.0.4664.45

• No issues found!

To Reproduce
Steps to reproduce the behavior:

  1. switch to flutter master channel
  2. flutter clean
  3. flutter run or flutter build apk

Expected behavior
The app runs /builds apk

logs
mahesh@Maheshs-MacBook-Air-M1 gallery % flutterm build apk
Running "flutter pub get" in gallery...                          1,239ms

Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Shrinking has been disabled for this build due to deferred components. Shrinking is not available for multi-apk applications. This
limitation is expected to be removed when Gradle plugin 4.2+ is available in Flutter.
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
   > Did not resolve 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30' which is part of the dependency lock state
   > Did not resolve 'org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.2' which is part of the dependency lock state
   > Did not resolve 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2' which is part of the dependency lock state
   > Did not resolve 'androidx.window:window:1.0.0-beta03' which is part of the dependency lock state
   > Did not resolve 'androidx.window:window-java:1.0.0-beta03' which is part of the dependency lock state
   > Did not resolve 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2' which is part of the dependency lock state

* Try:
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.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Running Gradle task 'assembleRelease'...                            4.4s
Gradle task assembleRelease failed with exit code 1
mahesh@Maheshs-MacBook-Air-M1 gallery % 
@maheshj01 maheshj01 added the bug Something isn't working label Nov 15, 2021
@maheshj01
Copy link
Member Author

cc: @guidezpl

@guidezpl
Copy link
Member

Hi, this might be a dupe of #545 , can you try building with --no-deferred-components?

@maheshj01
Copy link
Member Author

Looks like --no-deferred-components isn't available for building an apk or running the android app

mahesh@Maheshs-MacBook-Air-M1 gallery % flutter build apk --no-deferred-components    
Could not find an option named "no-deferred-components".


Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.

@andreidiaconu
Copy link
Contributor

You can either regenerate the lockfiles to get your build to work again with your current flutter version or you can use the latest flutter master.

@andreidiaconu
Copy link
Contributor

To regenerate the lockfiles the gradle command should be ./gradlew :generateLockfiles or if that does not work, you could use ./gradlew app:dependencies --write-locks with app being the gradle sub project you need to generate the lockfiles for.

@maheshj01
Copy link
Member Author

maheshj01 commented Nov 23, 2021

Thanks, @andreidiaconu, upgrading to the latest master, 2.6.0-12.0.pre.789 seems to have fixed the issue. I was able to run the app in debug mode, But the app failed to generate a release apk due to missing keys probably that's intended.

  • What went wrong:
    Execution failed for task ':app:validateSigningRelease'.
    Keystore file not set for signing config release

Feel free to close the issue if you think this issue is resolved.
Thanks, everyone.

@guidezpl
Copy link
Member

Great! And yes, that's intentional

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants