skip to Main Content

Execution failed for task ‘:google_mobile_ads:parseDebugLocalResources’.

Could not resolve all files for configuration ‘:google_mobile_ads: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:UsersbayukAppDataLocalAndroidsdkplatformsandroid-31android.jar.
> C:UsersbayukAppDataLocalAndroidsdkplatformsandroid-31android.jar

i have encouter this error when i try to run my app… did anyone know what is that mean ?
here is my pubspec yaml and manifest file:

    dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2
  get: ^4.6.6
  accordion: ^2.6.0
  firebase_core: ^2.17.0
  firebase_auth: ^4.10.1
  google_sign_in: ^6.1.5
  rflutter_alert: ^2.0.7
  firebase_database: ^10.3.1
  cloud_firestore: ^4.11.0
  google_mobile_ads: ^1.2.0

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:label="myapp"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-3940256099942544~3347511713"/>
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
              

            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

2

Answers


  1. Chosen as BEST ANSWER

    i already solved it it's because i don't have the android.jar file.. reference: missing android.jar when I try to run flutter project


  2. Hello there!

    This error message is indicating an issue with the Android SDK and the attempt to transform the android.jar file for platform version 31. It seems like there may be a problem with the Android platform version 31 that you have installed on your system.

    You can try to resolve this issue by the following steps:

    1. Check Android SDK Installation:

      • Make sure that you have the Android SDK installed properly and that it includes the platform version 31.
    2. Update Android SDK:

      • Open the Android SDK Manager and make sure you have the latest updates installed, especially for Android platform version 31.
    3. Clean and Rebuild:

      • Try running the Gradle clean and assemble tasks. This will clean the project and rebuild it, which can sometimes resolve dependency issues.

    ./gradlew clean
    ./gradlew assemble

    1. Check Dependencies:

      • Verify that all dependencies in your project’s build.gradle files are correctly specified and up to date.
    2. Check Gradle Version:

      • Ensure that you are using a compatible version of Gradle for your project. You can check the gradle-wrapper.properties file in your project for the Gradle version.
    3. Check SDK Platforms in Android Studio:

      • Open Android Studio and go to SDK Manager. Make sure that you have the necessary SDK Platforms installed, especially version 31.
    4. Re-download SDK Platform:

      • If there seems to be an issue with the android-31 platform, try deleting it and re-downloading it through the SDK Manager.
    5. Check for System Updates:

      • Ensure that your operating system and any related tools (like Android Studio) are up to date.
    6. Check Environment Variables:

      • Make sure that your environment variables related to Android SDK paths are correctly set.
    7. Check for Specific Issues with android.jar:

      • You might want to investigate if there are any specific issues reported with the android.jar file for platform version 31 in the Android SDK.
    8. Check for Known Issues:

      • Sometimes, specific combinations of tools, SDK versions, and Gradle versions can lead to compatibility issues. Check for any known issues or incompatibilities in the Android developer community.

    Hope your issue is resolved now. In case, you find any difficulty do not hesitate to ask.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search