hanabi1224 / flutter_appcenter_bundle

MIT License
21 stars 48 forks source link

Build fails (Execution failed for task ':flutter_appcenter_bundle:compileDebugKotlin') #19

Closed kmaxion closed 4 years ago

kmaxion commented 4 years ago

Currently getting this error when running flutter run

Launching lib/main.dart on sdk gphone x86 in debug mode...
FLUTTER_ROOT: /Users/user/dev/flutter                                
FLUTTER_ROOT: /Users/user/dev/flutter                                

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Execution failed for task ':flutter_appcenter_bundle:compileDebugKotlin'.
> Could not resolve all artifacts for configuration ':flutter_appcenter_bundle:debugCompileClasspath'.
   > Failed to transform file 'flutter.jar' to match attributes {artifactType=android-classes, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
      > Execution failed for JetifyTransform: /Users/user/dev/flutter/bin/cache/artifacts/engine/android-x64/flutter.jar.
         > Failed to transform '/Users/user/dev/flutter/bin/cache/artifacts/engine/android-x64/flutter.jar' using Jetifier. Reason: Cannot open a library at 'FileMapping(from=/Users/user/dev/flutter/bin/cache/artifacts/engine/android-x64/flutter.jar, to=/Users/user/.gradle/caches/transforms-2/files-2.1/e654be9adbdfd28b618c0de08d3a3186/jetified-flutter.jar)'. (Run with --stacktrace for more details.)

* 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 35s     

Works on my window machine but for some reason not on my mac. The folder /Users/user/dev/flutter/bin/cache/artifacts/engine/android-x64/ seen in error doesn't exist on my mac, it only has /android-x64-profile/ and /android-x64-release/ so maybe that's causing the issue?

Here's my flutter doctor -v output:

[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.5 19F101, locale en-US)
    • Flutter version 1.17.5 at /Users/user/dev/flutter
    • Framework revision 8af6b2f038 (8 days ago), 2020-06-30 12:53:55 -0700
    • Engine revision ee76268252
    • Dart version 2.8.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-30, build-tools 30.0.1
    • 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 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (2 available)
    • LM G820        • LMG820QM60becbe7 • android-arm64 • Android 10 (API 29)
    • sdk gphone x86 • emulator-5554    • android-x86   • Android 11 (API 30) (emulator)

• No issues found!
hanabi1224 commented 4 years ago

https://github.com/hanabi1224/flutter_appcenter_bundle/issues/10

p3root commented 4 years ago

Running into the same problem. Can compile it localy (windows 10) but not in appcenter build. Only occures for debug builds.

Mardaneus86 commented 4 years ago

Update: Looks like I missed the flutter precache step during the installation. It's working fine now.

~I noticed the same behavior on my new Macbook. Only difference between my old and new Macbook is that the path to the flutter.jar does not exist on my new one, eg the folder android-x64 is missing from the engine artifacts:~

~System.env.FLUTTER_ROOT + "/bin/cache/artifacts/engine/android-x64/flutter.jar"~

For reference, these were the engines available on a fresh install in the /bin/cache/artifacts/engine folder without the flutter precache command:

wongww commented 4 years ago

For reference, these were the engines available on a fresh install in the /bin/cache/artifacts/engine folder without the flutter precache command:

Running that command worked for me! Thanks. Even though echo $FLUTTER_ROOT didn't return anything, it still worked.