Reputation: 2558
I have downloaded gradle v4.1 and I'm trying to update my Flutter app to use the new gradle version in Android Studio 3.0.1 However, I get the errors below:
Error:Could not resolve all files for configuration ':app:debugAndroidTestRuntimeClasspath'.
Failed to transform file 'flutter-x86.jar' to match attributes {artifactType=android-classes} using transform JarTransform Transform output file Git/samplegradle/build/app/intermediates/flutter/flutter-x86.jar does not exist.
EDIT -
I followed this example to update gradle 3.0.1
manually, and it works for me, although it takes longer. I still haven't found a solution to update it using Android Studio.
Upvotes: 2
Views: 3757
Reputation: 2824
This is happening on me every time I do flutter clean
on a particular project.
My hack is to run (cd android/; ./gradlew flutterBuildX86Jar)
, which copies the missing file to the expected place.
Edit: Later I found out that the real problem was the order of the applied plugins. I added kotlin after creating project, and I need to apply kotlin plugin before flutter:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
Upvotes: 4
Reputation: 5239
Have you followed the steps outlined in Updating Flutter projects to Gradle 4.1 and Android Studio Gradle plugin 3.0.1?
Also, you probably have to upgrade your flutter install to 0.0.20
or later, if you haven't done that already.
Upvotes: 1