1

I get this error when I want to run "flutter" project from my phone with "visual studio code".

how can i solve it?

PROBLEM

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':path_provider_android:parseDebugLocalResources'.

Could not resolve all files for configuration ':path_provider_android:androidApis'. Failed to transform android.jar to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. > Execution failed for PlatformAttrTransform: C:\Users\Hp\AppData\Local\Android\sdk\platforms\android-31\android.jar. > C:\Users\Hp\AppData\Local\Android\sdk\platforms\android-31\android.jar

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

1

2 Answers 2

2

When the.jar file mentioned above was overlooked, this issue would arise. You must take a number of actions in order to resolve this issue.

step 1: Android Studio > SDK Manager > SDK Platforms

Android Studio SDK Manager

step 2: Select only Android 11.0(R) - API Level 30 (Uncheck other API Levels to Uninstall other API Levels temporary. Special API Level 31, 33) Apply & Ok

step 3: flutter clean

step 4: cd android

step 5: ./gradlew clean

step 6: ./gradlew build -> FAILURE: Build failed with an exception.

step 7: ./gradlew --stacktrace -> BUILD SUCCESSFUL

step 8: flutter run

Ensure that your development device is connected to a more reliable internet connection.

Sign up to request clarification or add additional context in comments.

Comments

0

you probably have to check if the version of the jdk you use is installed correctly

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.