Reputation: 51
I'm just trying to run the first app and this is what happens:
FAILURE: Build failed with an exception.
What went wrong: A problem was found with the configuration of task ':app:processDebugResources'.
File 'C:\Users\XXXX\Appdata\Local\Android\sdk\platforms\android-28\android.jar' specified for property 'androidJar' does not exist.
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.org
BUILD FAILED in 15s Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
The file is on the android-29 folder! what should I do?
Upvotes: 5
Views: 6715
Reputation: 1
In my case, the problem was solved using the following steps.
Upvotes: 0
Reputation: 1862
For some reason, android.jar
is't automatically downloaded or built when installing specific Android SDK versions. This oversight means Flutter cannot find the android.jar
, since it doesn't exist.
One solution, after installing the SDK version, is to manually download the android.jar
for your desired SDK version from the following GitHub repository:
https://github.com/Sable/android-platforms
Make sure to put the android.jar
file in the correct location, replacing XX
with your version number:
Windows
C:\Users\XXXX\Appdata\Local\Android\sdk\platforms\android-XX\android.jar
OS X
Users/<username>/Library/Android/sdk/platforms/android-XX/android.jar
Upvotes: 1
Reputation: 60923
Not only android.jar
is missing from my android-xx
folder, then copy android.jar
from other folder could solve this problem but I still have another problems when combine.
So I do a workaround
android-xx
folder from Android\sdk\platforms
app\build.gradle
of new project, I set both compileSdk
and targetSdk
to xx
android-xx
will contains all the filesI dont know if delete the old android-xx
before create new project is required or not. but I deleted it to make sure their is no other problem when replacing file
Upvotes: 0
Reputation: 179
This error might occur because of android.jar
is in another folder
Try opening
C:\Users\XXXX\Appdata\Local\Android\sdk\platforms
and then look
for a folder named android-29 or android-27 and you should be able to find android.jar
in that folder just copy that file and paste it into to android-28
Upvotes: 3
Reputation: 21
Image Please update your android sdk.
You don't have install api 28. Please open your android sdk and install android sdk 28.
Upvotes: 2