Cordova creates a package and imports it to android studio
Following Error:
1: Task failed with an exception.
-----------
* Where:
Script '/Users/admin/Projects/android_App/Android_1/platforms/android/CordovaLib/cordova.gradle' line: 112
* What went wrong:
A problem occurred evaluating project ': app'.
> Unable to determine Android SDK directory.
* Try:
Run with --stack trace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ': app'.
> compileSdkVersion is not specified. Please add it to build.gradle`
There is no plugin. I have updated all Cordova, npm, android studio with the latest one. But still not able to solve this issue.
SDK tools uninstall and install again.
Quick fix: Go to the Tools –> SDK manager –> SDK tools. Deselect Hide obsolete packages option on the right bottom and further install Android SDK Tools(obsolete). A new folder named Tools is now generated in the SDK directory.
Open the Tools\Options\Xamarin\Android Settings and set a new Android SDK Location (the folder should not exists). automatically the IDE detect that the Android SDK is not installed and it will propose you to install all the required components. after that open the Tools\Android\Android SDK Manager...
If the adb is not present, installing the platform-tools resolves the problem. For this, open Android Studio, click on SDK Manager in the toolbar or click Tools > SDK Manager, click on SDK Tools, then check-mark '✓' Android-SDK Platform-Tools (as shown below).
Step 1: Opening Android Studio Settings. Navigate to the File > Settings option you will get to see below dialog screen. Inside that screen. Click on Appearance and Behavior option > System Settings options and then click on the Android SDK option to get to see the below screen.
Click on Appearance and Behavior option > System Settings options and then click on the Android SDK option to get to see the below screen. Inside this screen, you will get to see your SDK path.
Open the SDK Manager from Android Studio by clicking Tools > SDK Manager or click SDK Manager in the toolbar. Click the checkbox next to Android SDK Platform-Tools so it shows a checkmark.
1. Fix Unable To Access Android SDK Add-On List Error Steps. Click the Cancel button in the above popup dialog. Then it will show you the Missing SDK window in the Android Studio Setup Wizard. The title is No Android SDK found, the detail message is Before continuing, you must download the necessary components or select an existing SDK.
Finally, I found the solution. Its a Corova package issue. By default under android local.properties file will be creating while adding cordova platform android. Now that file is not adding.
Create new file --> Project--> Platform --> android--> local.properties
and keep this --> sdk.dir=/path/sdk example [sdk.dir=/Users/admin/Library/Android/sdk]
then it starts working.
Thanks.
I was creating a project from ionic 3
. I run ionic cordova platform add android
and generated the Android Project.
When I tried to run the project then I got the above issue.
At the Project level, I did follow step
Create new file --> Project--> Platform --> android--> local.properties
Add this line:--> sdk.dir=/Users/anilgupta/Library/Android/sdk
and hit sync now. (anilgupta -- use your username for mac)
It builds the new Gradle and syncs with Project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With