libGDX can not see Android SDK - android

I am a newbie android develiper. I have just installed the most recent Android Studio and downloaded libGDX setup tool. However, when I try to generate a new project, it shows the error:
Your Android SDK path doesn't contain an SDK! Please install the Android SDK, including all platforms and build tools!
I am pretty sure I have Android SDK installed and I put a correct location C:\Users\Denis\AppData\Local\Android\Sdk, because I copied it from Android studio.

This is how libGDX is checking if android SDK location valid:
public static boolean isSdkLocationValid (String sdkLocation) {
return new File(sdkLocation, "tools").exists() && new File(sdkLocation, "platforms").exists();
}
However, I don't have tools folder in my setup. Probably, in fresh Android SDK it was renamed or I don't have required tools installed, not sure (pls suggest in comments). However, the workaround is to create an empty tools folder in C:\Users\Denis\AppData\Local\Android\Sdk

I just had the same issue to day. I think the problem is that the SDK that comes with Android Studio dos not contain the "tools" folder. You'll have to download it manually and add it to the SDK. Here is the link. I hope this helps you.

I found a lot of questions similar to this and found the following information
"Where does Android Studio install sdk on Mac?
Configure Android SDK Variable In macOS.
Generally, the Android SDK is installed in the /Users/user-name/Library/Android/sdk folder on macOS."
https://www.dev2qa.com/how-to-set-android-sdk-path-in-windows-and-mac/
In your "Android SDK: " area on libGDX you can type in the following path and just replace with your username
/Users/"user-name"/Library/Android/sdk

Related

Cordova gradle wrapper missing in android sdk

I'm on windows7 x64, installed today's latest stable release of android sdk studio (through android studio bundle, since it's shipped together now apparently). I have properly configured the environment variables as you'll see above.
This is what I get when issuing the following command
$ cordova build android
ANDROID_HOME=G:\installs\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: G:\installs\Android\sdk\tools\templates\gradle\wrapper
And indeed, the "templates" directory doesn't even exist in my sdk install.
I've already tried the suggestions (setting the right path, uninstall/reinstall) of this question here but nothing applies to my case, and I find that manually copying and pasting packages is not really a solution, since there's a package manager in place.
If anybody has an answer as of today's android install, would be very much appreciated.
If still not working then copy all file from gradle\wrapper from Android Studio installation folder
C:\Program Files\Android\Android
Studio\plugins\android\lib\templates\gradle\wrapper
and paste it in your Android SDK gradle\wrapper then run same command.
E:\android-sdk\tools\templates\gradle\wrapper
This is a known issue; see CB-12544. For now you'll need to downgrade.
I downloaded Android SDK r25 manually and placed templates folder inside Android/sdk/tools. This solved the issue for me.
You can get it from https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip
For Windows:
https://developer.android.com/studio/index.html
Go to the section :"Get just the command line tools"
There is a link 'sdk-tools-darwin-3859397.zip' for Mac, Unfortunately that didn't have the templates folder with Gradle Wrapper. So for Mac users, i will suggest not to go for this zip.

Appcelerator 4 cannot find Android SDK on Mac

Appcelerator Studio 4.7.1.201609100950 on Mac OS X cannot find Android SDK. I have downloaded it with the button on the Appcelerator Studio Dashboard. After download was successfully finished, the Appcelerator Studio was not able to recognise it.
I was getting the following error : [Android SDK Home] No Android SDKs were found under the specified SDK location
I had this issue as well. The reason is (for me at least) is when I first created the App, it was with an older version of Studio & SDK.
One solution, is create a new Project with the latest SDK & Studio, then paste all your code in that new project (make sure everything is updated correctly in tiapp.xml), then you will see there is no more issues running Android.
You can also try it with just a new Mobile Project (with latest SDK, currently 5.5.1.GA), and see if it runs on Android. If this works, you can move all your code to this new project.
Did you try this:
To use the Android SDK with Studio, the path to the SDK must be set in the Preferences dialog.
Open the Preferences dialog:On Mac OS X, from the menu bar, select Appcelerator Studio > Preferences.
In the Preferences dialog, navigate to Studio > Platforms > Android.
Enter the path to your Android SDK in the [Android SDK Home] textbox by clicking Browse then navigate to the SDK directory.
The Android SDK will be found in the Library folder...something like /Users//Library/android-sdk
You did install the android-sdk right!?
What happens from command line when you run appc ti info -t android?
Also, check your Android SDK setting in appc ti config as well as check to see if you've set an environment variable in
/~/.bash_profile called ANDROID_SDK
, and if so that it matches the correct current location of the SDK
If you can't solve this try to change your sdk directory and change it in appcelerator too.
Hope that will help you.
I personally store my SDK and NDK in
/opt/android-sdk
and
/opt/android-ndk
with links in the .bash_profile
export ANDROID_SDK=/opt/android-sdk
export ANDROID_NDK=/opt/android-ndk
finally, use appc ti setup android to set the paths there as well. Both Studio and CLI will pick it up properly from there. Thx!

Missing Gradle in Android SDK (using cordova + ionic)

Yep, i searched about this but nothing, just things about the ANDROID_HOME path, but in my case i don't think this is the real problem. When i try to do ionic build android i get this error:
Error: Could not find gradle wrapper within android sdk. Might need to update yo
ur Android SDK.
Looked here: C:\Android\sdk\tools\templates\gradle\wrapper
And found that in C:\Android\sdk\tools i dont have "templates" folder, just this:
I see gradle wrapper only in this path C:\Android\sdk\temp\ToolPackage.old01\templates\gradle\wrapper
Why i don't have Gradle in my sdk folder? i am missing something? in SDK manager i have this installed:
Thanks in advance
Had exactly the same problem. This thread points out the reason behind it, and this one actually shows what to do.
In short:
in Android Studio uninstall Android SDK Tools
Download tools_r25.2.3-yourOPsystem.zip from Android Downloads. Basicly same thing, older version.
insert downloaded extracted tools folder in Android/sdk/ folder
(MAC: /Users/username/Library/Android/sdk/tools
Win: C:\Users\username\AppData\Local\Android\sdk\tools)
In project folder run:
$ cordova platforms remove android
$ cordova platforms add android
On Linux android studio version-162.3871768-linux
copy paste
\Android Studio\plugins\android\lib\templates\
to Sdk/tools/
You need to update ANDROID_HOME variable to point the android-sdk folder
https://stackoverflow.com/a/32507036/344895
you have to upgrade your cordova library
cordova platform update android#6.2.1
I tested upgrade cordova to version 6.5 and extract tools SDK. Nothing helps.
In my case I have Android Studio installation.
SOLUTION: Please find file gradle-wrapper.jar in your Android Studio installation (in may case ..\Android Studio\plugins\android\lib\templates\gradle\wrapper\gradle\wrapper\ ). Then copy whole directory templates to SDK location in subfolder tools.
Set ANDROID_HOME to the SDK Path displayed in your Android SDK Manager. The default location is C:\Program Files (x86)\Android\android-sdk if you didn't change it.
go to https://developer.android.com/studio/index.html
cheak Download Option and download tools only
extact file and copy the templates folder
and paste in C:\Users(yourunername)\AppData\Local\Android\sdk\tools
update your sdk tools download tools_r25.2.3-yourOPsystem.zip.
[direct download link][1]
/Users/username/Library/android/sdk/tools
You cant find gradle in latest sdk. So try to install it manually. Follow this link
https://gradle.org/install

Android SDK not found by PhoneGap/DreamWeaver CS6

I'm trying to use PhoneGap on Dreamweaver CS6 with the Android SDK. Under Phonegap build settings, I add the location of the SDK('\Android\android-sdk').
I get back the following message "The SDK location provided for Android is not valid. Please verify your settings.".
Anyone know what I'm doing wrong here?
You will need to add two subdirectories to your path: /tools and /platform-tools
http://developer.android.com/sdk/installing.html
Try upgrading the Android SDK and install it to a different directory.
Then point your Dreamweaver to that new directory.
You probably have to have a valid AVD there as well.
If you launch the Android SDK Manager it shows you the SDK path at the top of that window. I just used that and it worked.

how to add Android platform into Netbeans 7.0, after installed android plugin

I installed Android plugin using Tools/Plugins/Settings and copied the link there, and so on. In the next step, I would get to Tools/Java Platforms/Add platform, then it pope up with "1.Choose the platform folder" instead of "1.Select platform type". Because of that, I couldn't proceed into the next steps.
I tried to remove and reinstall Java SDK and Netbeans several times using different methods. But nothing has changed. I really appreciate the answer.
Thanks
You are following one of outdated install guides/tutorials. Current version of Android support only needs to know where your Android SDK is. Go to Tools | Options | Misc | Android and set the location there. You can find more details at http://www.nbandroid.org/
It can even detect this location automatically if you open some configured project but it seems this is not your case.
After installing the plugin the sdk and the platform then choose from netbeans file new project android project next choose the target platform listed under target name input package name and voila.
Installing the platform is a seperate step. Look in the sdk folder and read the readme. On linux, at least, it says to run the "android" program, which is in the tools folder. After installing the platform through this it should let you progress in setting up netbeans.
It's not an obvious step if you're a noob and head straight to google with "setup netbeans for android"

Categories

Resources