android - Flutter Build failed for sqflite_android - Stack Overflow

When i run my flutter project for my phone, i get this error (which i hadn't before updating andro

When i run my flutter project for my phone, i get this error (which i hadn't before updating android studio & other things like flutter & dependencies) :

Launching lib/main.dart on moto e40 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sqflite_android:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':sqflite_android:androidJdkImage'.
   > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, .gradle.libraryelements=jar, .gradle.usage=java-runtime}.
      > Execution failed for JdkImageTransform: /home/user/Documents/programmation/Android/sdk/platforms/android-34/core-for-system-modules.jar.
         > Error while executing process /home/user/Downloads/rpms/archives/android-studio.new/jbr/bin/jlink with arguments {--module-path /home/user/.gradle/caches/transforms-3/4a46fc89ed5f9adfe3afebf74eb8bfeb/transformed/output/temp/jmod --add-modules java.base --output /home/user/.gradle/caches/transforms-3/4a46fc89ed5f9adfe3afebf74eb8bfeb/transformed/output/jdkImage --disable-plugin system-modules}

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

BUILD FAILED in 5s
Error: Gradle task assembleDebug failed with exit code 1

i tried several things, including :

  • deleting ~/.graddle/caches
  • deleting ~/.graddle
  • deleting ~/.pub-cache
  • switching back to the old android studio version
  • pub remove / add sqflite
  • ...

When i run my flutter project for my phone, i get this error (which i hadn't before updating android studio & other things like flutter & dependencies) :

Launching lib/main.dart on moto e40 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sqflite_android:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':sqflite_android:androidJdkImage'.
   > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, .gradle.libraryelements=jar, .gradle.usage=java-runtime}.
      > Execution failed for JdkImageTransform: /home/user/Documents/programmation/Android/sdk/platforms/android-34/core-for-system-modules.jar.
         > Error while executing process /home/user/Downloads/rpms/archives/android-studio.new/jbr/bin/jlink with arguments {--module-path /home/user/.gradle/caches/transforms-3/4a46fc89ed5f9adfe3afebf74eb8bfeb/transformed/output/temp/jmod --add-modules java.base --output /home/user/.gradle/caches/transforms-3/4a46fc89ed5f9adfe3afebf74eb8bfeb/transformed/output/jdkImage --disable-plugin system-modules}

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

BUILD FAILED in 5s
Error: Gradle task assembleDebug failed with exit code 1

i tried several things, including :

  • deleting ~/.graddle/caches
  • deleting ~/.graddle
  • deleting ~/.pub-cache
  • switching back to the old android studio version
  • pub remove / add sqflite
  • ...
Share Improve this question asked Nov 15, 2024 at 22:01 michel duturfumichel duturfu 314 bronze badges 3
  • It may be a mismatch and configuration issue with your gradle and Android SDK. I recommend to open the "android" folder of the Flutter project with Android Studio and let the IDE to build the gradle. If there is any conflict, it will show you the exact error in the build message section. – saman Commented Nov 16, 2024 at 4:53
  • android studio is happy with my graddle, no error whatsoever. iI just get this warning before building : Warning: SDK processing. This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times. – michel duturfu Commented Nov 16, 2024 at 9:02
  • 1 neverming, i managed to get rid of that warning by updating android sdk to api35 – michel duturfu Commented Nov 16, 2024 at 9:05
Add a comment  | 

2 Answers 2

Reset to default 1

Solved it by updating id "com.android.application" version "8.1.0" apply false to id "com.android.application" version "8.7.2" apply false in android/settings.graddle

android studio didn't told me there was a newer version

(got that info here)

michel duturfu solutions work for me,

inside android/settings.gradle, change id com.android.application to version 8.7.1 apply false,

in gradle-wraper.properties, change distributionUrl to https://services.gradle./distributions/gradle-8.9-all.zip.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745674210a4639586.html

相关推荐

  • android - Flutter Build failed for sqflite_android - Stack Overflow

    When i run my flutter project for my phone, i get this error (which i hadn't before updating andro

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信