Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to determine Android SDK

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.

like image 633
sarathi Avatar asked May 05 '21 09:05

sarathi


People also ask

How do I fix Android SDK not found?

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.

Why Android SDK is not installed?

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

How do I fix Android SDK file not found adb?

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

How to enable Android SDK in Android Studio?

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.

How to find SDK path in Android?

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.

Where can I find the Android SDK manager?

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.

How to fix unable to access Android SDK add-on list?

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.


Video Answer


2 Answers

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.

like image 111
sarathi Avatar answered Oct 14 '22 10:10

sarathi


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.

like image 40
Anil Gupta Avatar answered Oct 14 '22 09:10

Anil Gupta