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
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
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:
Check Android SDK Installation:
Update Android SDK:
Clean and Rebuild:
clean
andassemble
tasks. This will clean the project and rebuild it, which can sometimes resolve dependency issues.Check Dependencies:
build.gradle
files are correctly specified and up to date.Check Gradle Version:
gradle-wrapper.properties
file in your project for the Gradle version.Check SDK Platforms in Android Studio:
SDK Manager
. Make sure that you have the necessary SDK Platforms installed, especially version 31.Re-download SDK Platform:
android-31
platform, try deleting it and re-downloading it through the SDK Manager.Check for System Updates:
Check Environment Variables:
Check for Specific Issues with android.jar:
android.jar
file for platform version 31 in the Android SDK.Check for Known Issues:
Hope your issue is resolved now. In case, you find any difficulty do not hesitate to ask.