Cordova/Phonegap Android target: not installed [Android Studio Installed]
Asked Answered
C

3

9

Still facing this issue. I searched all over google could not found a solutions.

  • Mac OSX Sierra
  • Android Studio 2.3
  • Cordova/ Phonegap (Latest Version)

Requirements check results for android:

  1. Java JDK: installed 1.8.0
  2. Android SDK: installed true
  3. Android target: not installed Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
  4. Gradle: installed

Error: Some of the requirements check failed

.bash_profile
================================
# Setting JAVA_HOME Path

JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home"

# Setting ANDROID_HOME Path

ANDROID_HOME=“/Users/{localpath}/Library/Android/sdk”

# Setting GRADLE_HOME Path

GRADLE_HOME=“/Users/{localpath}/Library/Android/gradle/gradle-3.4”

export PATH=“${GRADLE_HOME}/bin:${PATH}”
export PATH="${ANDROID_HOME}/tools:$PATH"
export PATH="${ANDROID_HOME}/platform-tools:$PATH"

Andriod Manifest

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.company.myAPP" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="25" />
</manifest>

Android Studio Installed SDK

Cal answered 8/3, 2017 at 9:18 Comment(1)
R
16

Facing exactly the same error, I encountered this answer on forum.ionicframework.com:

As easy as that.

I had the problem on Mac, so I did download the SDK tools373, copy-paste it in /Users/username/Library/Android/sdk, and it worked instantly.

But I absolutly don't know what causes the issue.

And I don't know what causes the issue either, but it helped me and everything works as expected.

Reverberate answered 18/3, 2017 at 14:42 Comment(3)
This is a magical, wonderful answer and should be the accepted one. Wonder why that is / didn't come with Android Studio.Karyokinesis
Same here... A lot of files were missing when installed via the Android Studio compared to the package which i downloaded from: developer.android.com/studio/index.html#command-tools - Thanks!Carlock
FYI: I had to add export PATH="/Users/*USERNAME*/Library/Android/sdk/tools:$PATH" into my ~/.bash_profile followed by reloading it with source ~./.bash_profile for this to work for me. Just be sure to replace USERNAME with your username!Humfrey
I
2

Facing with same error. Maybe this info will be helpful.

In the latest Android SDK Tools (v25.3.1), the android command no longer operates as expected and instead exits with a non-zero status code and provides a message telling folks to use the sdkmanager and avdmanager commands.

try to execute android in terminal if it will return something like this:

The android command is no longer available.For manual SDK and AVD management, please use Android Studio.For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager

then you need to downgrade your SDK to v25.2.5 or less. Instruction can be found here

Imagination answered 27/3, 2017 at 14:25 Comment(0)
B
1

I downgraded Android SDK FROM latest release 10.0(q) to API level 29 TO 9.0(pie) API level 28 by the user guide here then added this in a .bash_profile

export ANDROID_HOME=${HOME}/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools

everything works fine I hope that it can help someone

Brigantine answered 16/10, 2019 at 19:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.