What exactly is "tools.jar" in the Android SDK? - android

So, I've been trying to build a project in LibGDX for about 10 hours now. In case you'r unfamiliar, LibGDX is one of those platforms where you specify a project directory at the start, along with any required SDKs and then when you're ready to start coding it will generate a project for you.
Anyway, I've been having a problem where every time I try to build it fails with the single error message:
Execution failed for task :core:compileJava.
Could not find tools.jar
I'm guessing "tools.jar" is a package within the Android SDK, as this is the only repository needed to build, it doesn't ask for a JRE or even the Java SDK. just the Android SDK.
I have been looking in the SDK manager, I have installed all of the packages labelled "Android-SDK Tools", "Android-SDK Platform Tools" and "Android SDK Build Tools" but there is nothing else that includes "tools.jar", I am looking for some light shed on this topic as it is a very grey area. I would like to know where this .jar file comes from and what exactly it includes. Can it be installed from the Android SDK?
There have been similar questions like this before which only fit narrow situations, If someone could provide a holistic description of the tools.jar package it would benefit a great deal for me and everyone else that needs it in their 3rd-party android IDEs.
For the record, it's building with Gradle and my current SDK is well-equipped enough to build full-fledged apps in Android Studio.
Please don't answer this question with a question unless I have left out some information that is dire to finding an adequate solution

Try copying tools.jar from %JAVA_HOME\lib to Android Studio\lib

For me, copying tools.jar to Android lib folder alone didn't solve my problem.
But I also had to create a System Variable 'JAVA_HOME' in Windows Environment Variables with path to the latest JDK folder.
Restarted Android Studio, and this solved by problem.

My Android Studio Version: 4.2.1
The "tools.jar" is provided by Oracle JDK which is required by android studio for compilation - I have faced this issue after updating android studio to latest version in my PC.
To Resolve the issue follow below steps:
In Android studio File -> Project Structure -> SDKs (Under Platform Settings)
A) Add JDK path by pressing '+' symbol in middle pane if suppose JDK/JDK home path is not present in the middle pane already (Middle pane also contains the Downloaded Android SDK's)
B) Java sdk will be usually present/installed in the path
64 bit => "C:\Program Files\Java\jdk1.X.Y_ABC" (In my PC it is 1.8.0_202) or
32 bit => "C:\Program Files (x86)\Java\jdk1.X.Y_ABC"
If suppose you don't have JDK installed in your PC, please download and install from Oracle Java website
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
Set JDK and JRE Path(Download both from webpage mentioned in step 2) in system environment variable
A) Press windows key type "Edit the system environment variables" and open the application
B) Go to Advanced -> Environment Variables
Under system variables add JAVA_HOME and JRE_HOME as below
Set Windows system environment variable
Add jdk lib path on the Path environment variable under user variables (this step is required only if the error not resolves with the previous steps)
C:\Program Files\Java\jdk1.X.Y_ABC\lib

In my case, I have five jdk and some have tools.jar and other not, my solution is copy paste this tools.jar in all lib of jdk.

Nothing worked for me. So I Copied tools.jar and pasted it in C:\Users\UMAR_\AppData\Local\Android\Sdk\platforms\android-30 which is the path to the library for the Android API 30 Platform. I pasted tools.jar in every folder and it start working.
I didn't have tools.jar initially but followed this link and downloaded https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
Also added to a environment variable.. but what worked was in the first para, I still don't know if adding to variable was necessary or not.

Related

Installing new Android studio Beta v.0.8.14

Hello I am new in Android development
So as suggested by google I downloaded the latest October 2014 beta version of Android Studio to start developing because they will end up solely with the Android Studio IDE so I thing it is a good idea to get used of it...
To install they just give you a zip file. I unzipped it and followed the text instructions which were simple BUT I cannot find the files and folders the say should exist in their unzipped folder/files :s .
The instructions are
'' To set up Android Studio on Windows:
Unzip the file, android-studio-ide--windows.zip and launch the studio.exe file.
Follow the setup wizard to install Android Studio and the SDK Tools.
On some Windows systems, the launcher script does not find where Java is installed. If you encounter this problem, you need to set an environment variable indicating the correct location.
Select Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.7.0_21. ''
Although I find the studio.exe at the path \android-studio-ide-135.1538390-windows\android-studio\bin
I cannot find any kind of a setup wizard for the SDK Tools!!
When I start the studio.exe program and I go to Configure/Project Defaults/Project Structure
the java sdk has been found but the android sdk folder naturally it is not.
And also the Configure/SDK Manager is not enabled.
What obvious thing am I missing here??
Thanks
If you downloaded android-studio-ide-135.1538390-windows, then it only contains the IDE and not the Android SDK. You need to download it separately:
http://dl.google.com/android/installer_r23.0.2-windows.exe
link
You will then point Android Studio to your SDK installation location.

Android Studio Error: "You must install the Android Support Repository though the SDK Manager"

I just initialised a project on Android Studio, and it was working fine in version 0.2.6, but in 0.2.7, I get this error:
It creates a folder inside my Applications directory, but it does not initialize the project. Any help regarding this problem would be appreciated. I get no problems with version 0.1.1 through version 0.2.6, but when it comes to 0.2.7, things start to get problematic, like this and I can't even start a project.
With 2.7 update I got the same issue. It looks like now Android Studio thinks sdk lays in under its own folder at android-studio/sdk.
You should be able to use android app under android-studio/sdk/tools to get missing components (not tested).
Another solution would be to fix sdk path (tested):
Close any projects then drop to Welcome to Android Studio Dialog
Select Configure -> Project Defaults -> Project Structure
Select SDKs -> Android SDK -> Android SDK Home Path
Update it to your previous sdk location.
got the same problem when applying the last patch (2.7). I've resolved it by copying SDK Manager.exe from android-studio\sdk\tools\lib to android-studio\sdk\ then I've launched it and install the missing component.
After restarting Android Studio it works again !
You must manually run SDK Manager.
Folder: android-studio/sdk/tools
Search for android or android-sdk
The new Support Repository must be already selected, and you need only click the "Install" button.
Just as Leonidos said, install ASR through SDK Manager:
Tools > Android > SDK Manager ; Navigate to the Extras folder, and select Android Support Repositories.
Click install packages and it will work fine
I did a fresh install of Java, SDK and Android Studio, update it to 0.2.7 and install the ASR through SDK Manager, but the messages comes again.
So i found this solution.
The most common problem for Android Studio and 64Bit Windows System is the no 8.3 short path for
C:\Program Files and C:\Program Files (x86).
find_java.exe
couldn't handle it and give a wrong path back.
Finally do this:
dir /x C:
-- It shows no 8.3 short paths.
fsutil 8dot3name query C:
-- It shows NtfsDisable8dot3NameCreation is 1 on "C:",
means 8.3 short path won't be created in "C:".
Then I enable the generation of 8.3 short name by:
fsutil 8dot3name set C: 0
and create short names for C:\Program Files and C:\Program Files (x86) in windows recovery mode by:
fsutil file setshortname "C:\Program Files" PROGRA~1
fsutil file setshortname "C:\Program Files (x86)" PROGRA~2
And now dir /x C: can show the short names.
And now find_java.exe -s
can show the short path C:\PROGRA~1\Java\JDK17~1.0_2\bin\java.exe.
And now find_java.bat and android.bat can work good now!
source
Also copying SDK Manager.exe from android-studio\sdk\tools\lib to android-studio\sdk\
Just a few ideas to try that should hopefully help. These can be found by using Ctrl + Shift + A.
"Sync project with Gradle" - (it's also often in the toolbar with a green and yellow ball and a blue down arrow next to three android icons)
"Gradle" and select the ToolBox option; then hit the blue refresh icon to refresh all the gradle projects
"Project Structure..." (also available under File) Under the Libraries project settings you should see a valid reference to your support library. You'll also want to skim through everything to make sure everything else looks good with the project.
"Invalidate Caches..." (another available under File) Invalidate and restart. This one got me going again after the previous upgrade generated a bunch of errors.
Some of these may be redundant, but after having fought with similar issues in the past it's just a few easy things I've found to check.
If refreshing everything doesn't work you can always pull up the Android SDK from Tools -> Android -> SDK or from the toolbar with the blue/green boxy android that has a black down arrow. It should be next to the Sync Gradle button.
I update the Android Studio(AS) and see the same issue.
However, there is something slightly different about what I find out.
I actually have two sdks because I shift from Eclipse to AS.
Hence, I get one sdk in
c:\Program Files(x86)\Android\android-sdk
and anther in
c:\Android\android-studio\sdk.
And the real one that I use is in c:\Program Files(x86)\Android\android-sdk.
The important thing is that, I find that only one of the sdk setting is changed after the update.
Quick Start > Configure > Project Defaults > Project Structure
> Platform Settings > SDKs
1.7
JDK home path:
C:\Program Files\Java\jdk1.7.0_10
Android 2.2 Platform
Android SDK home path:
C:\Program Files(x86)\Android\android-sdk
Android 4.0.3 Platform
same as 2.2
Android 4.2.2 Platform
Android SDK home path:
C:\Android\android-studio\sdk <- it is modified after update!!!!
Android 4.3 Platform
same as 2.2
After fixing the path in 4.2.2, I could create new project successfully again.
For some reason, if you install Android Studio in the same directory as the SDK, this error will pop up. Just install it somewhere else.
For instance, I had it installed at C:\Android\, along with the SDK. Then, I decided to install it at C:\Program Files (x86)\Android Studio and it simply worked.

Android Studio Can't Find JDK Mac

I'm just trying out Android Studio. I imported a project from Eclipse, but every time I try
to run it I get this error:
"Cannot run program
"Library/JavaVirtualMachines?jdk1.7.0_10.jdk/Contents/Home/bin/java"
(in directory
"/Users/myname/Library/Caches/AndroidStudioPreview/compile-server"):
error=2, No such file or directory.
I just installed the latest JDK using the JDK 7 Update 21 dmg. Is it installing the jdk in a place where Android Studio won't find it? The dmg didn't have any options for where to install the jdk other than "Install for all users of this computer," which I did.
When I was using Eclipse I had no problems with running my programs.
Furthermore, the Project Structure option was no longer available after I updated earlier today. Instead I just get the message, We will provide a UI to configure project settings later. Until then, please manually edit your build.gradle file(s.)"
I'm not sure what to do to get my programs running again. Do I need to locate the jdk files and move them? Could I tell Android Studio where the files are actually installed?
The solution was easier than I thought: just go to File/Other Settings/Default Project Structure and click SDKs. There the JDK home path can be changed.
Yes changing the JDK path will work. If that doesn't fix your problem, as it didn't for me at first, uninstall your JDK and redownload and install it. Once I reinstalled mine, it worked flawlessly.

Android Studio installation on Windows 7 fails, no JDK found

I downloaded Android Studio and attempted to launch the program.
This is running on Windows 7 64-bit with Java 1.7. During the installation, my Java 1.7 is detected, and the rest of the installation goes through just fine. However, when attempting to launch the application from the desktop icon, nothing happens. Looking at the task manager, a new process from the CMD is loaded. This is because it's attempting to run the batch file studio.bat.
When I execute via CMD, I get the following error:
ERROR: cannot start Android Studio. No JDK found. Please validate
either ANDROID_STUDIO_JDK or JDK_HOME or JAVA_HOME points to valid
JDK installation. ECHO is off. Press any key to continue . . .
I've attempted to open the idea properties file to see if there was something I could configure for this ANDROID_STUDIO_JDK or something like that. However, I found nothing. I hope some of you can let me know if you were able to install this or if you are having problems as well.
Adding a system variable JDK_HOME with value c:\Program Files\Java\jdk1.7.0_21\ worked for me. The latest Java release can be downloaded here.
Additionally, make sure the variable JAVA_HOME is also set with the above location.
OK, I figured out how fix this nasty bug.
Before you start
Go to your Android Studio installation folder and locate the bin folder. Inside the bin folder, you will find studio.bat. Execute the file, and it'll show the error. If it is about the Java path then follow the tip 1.
Tip 1
When you set the path JAVA_HOME, etc., make sure not to include bin at the end of the path. This solved the issue for me.
JAVA_HOME => C:\Program Files\Java\jdk1.7.0_21
path => C:\Program Files\Java\jdk1.7.0_21\bin
It works fine with JDK 1.7 (I tried with 32 bit).
If you do so, you can see the initial screen as below.
Tip 2
Are you getting the below error message?
Your Android SDK is out of date or is missing templates. Please ensure
you are using SDK version 22 or later.
This error probably occurs, because you have reference to your older SDK (that you downloaded with Eclipse) in your path variable. Go to Environment variables and remove any reference to the old SDK folder and point it to new SDK folder that is found inside the Android Studio installation folder.
Save and restart Studio, things should work as expected now.
Tip 3
If you hate messing around with the path variable as given above by removing old references, simply follow the following steps to refer to new SDK path that comes with Studio.
*Project Defaults* -> *Project Structure* -> Click "New" -> Select "Android SDK" -> Select the SDK folder inside the studio installation.
With the last update of Android Studio, I have two versions of the IDE's launcher
One is called studio.exe and the other studio64.exe they are both on:
C:\Users\myUserName\AppData\Local\Android\android-studio\bin
You have to launch the one that matches your Java version 64 or 32 bit
I had the same issue. I got resolved setting up correctly the environment variables in windows, for instance:
JAVA_HOME -> C:\Program Files\Java\jdk1.6.0_45
path -> C:\Program Files\Java\jdk1.6.0_45\bin
I've tried so many of the answers here but none of them works, so I decided to mix some of the answers here and I am successful!
Step 1: Go to the system properties by right-clicking on My Computer or by pressing windows button on typing This PC and right clicking on it and selecting Properties.
Step 2: Click the advanced system settings or Environment Variables
Step 3: Take note that there are 2 different variable. What you need to create is system variables not user variables, when you clicked new type the following
Variable name: JAVA_HOME
Variable value: C:\Program Files\Java\jdk1.8.0_25\ (Note: Please check if the path is right, sometimes it is C:\Program Files (x86)\Java\jdk1.8.0_25)
Step 4: Run the android studio, no need to restart.
Note:
*C:\Program Files\Java\jdk1.8.0_25\ depends entirely on the installation path of your JDK not JRE so don't be confused if you see something like the picture below. Just enter the location of your jdk, in my case it is C:\Program Files\Java\jdk1.8.0_25\.
*Do not include the bin folder when you enter the Variable value.
Edit: For Windows 8 and 10 Users: Try to run C:\Program Files\Android\Android Studio\bin\studio.exe instead of C:\Program Files\Android\Android Studio\binstudio64.exe
I had the same issue. I am having 64-bit windows 8. I downloaded the android studio which worked on a 32-bit machine but not on my 64-bit.
The solution for me was pretty simple. I navigated to
C:\Program Files (x86)\Android\android-studio\bin
there I saw 2 exe files studio.exe and studio64.exe. Normally my start menu was pointing to studio64.exe which always kept on giving me "The environmental variable JDK_HOME does not point to valid JVM". So then I clicked studio.exe and it worked :)
I hope this may help someone facing the same problem as me
The path for the latest JDK. It worked very well.
If you are getting message "Your Android SDK is out of date…" — click "Configure" —> "Project Defaults" —> "Project Structure", pick "SDKs" —> "Android SDK" and in a "Build Target" choose "Android 4.2.2". Click "OK". Now it should work fine.
I got the problem that the installation stopped by the "$(^name) has stopped working" error. I have installed the Java SE Development kit already, and also set both SDK_HOME and JAVA_HOME that point to "C:\Program Files\Java\jdk1.7.0_21"
My laptop installed with Windows 7 64 bits
So I tried to install the 32-bit version of the Java SE Development kit, and set my JAVA_HOME to "C:\Program Files (x86)\Java\jdk1.7.0_21", restart and the installation worked OK.
This problem has been fixed in Android Studio v0.1.1, so just update Android Studio and it should work.
Sometimes you can resolve this type of issue by setting environment variables so the process looks for the JDK in the right spot.
Another approach is to figure out where the process is looking, then put your JDK there.
I've had lots of success using Process Monitor from Sysinternals:
Start -> Run -> procmon
Go to the Filter menu, then select Filter...
Set Event Class is File System then Include
Add, then OK
This will filter down to all the file system operations taking place on your machine.
You could try filtering based on the result of the File System operation:
Right click on the Result column, then Exclude 'SUCCESS'
You can also quite easily filter based on the process name, either from the Filter... menu option or by right clicking on the Process Name column and selecting Include 'process.exe'.
Once you find the file system operation that's failing, the Path column will tell you where to put your JDK.
I've found this to be very empowering. Especially compared to the frustrating process of changing environment variables by trial and error.
My issue was caused because I have an & character in my Windows user name, so when installed in the default path I was getting the following error after running bin/studio.bat
|
v notice broken path
The system cannot find the file C:\Users\Daniel \studio64.exe.vmoptions.
Exception in thread "main" java.lang.NoClassDefFoundError: com/intellij/idea/Main
Caused by: java.lang.ClassNotFoundException: com.intellij.idea.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: com.intellij.idea.Main. Program will exit.
So I uninstalled and reinstalled it to program files and it launches fine now.
I couldn't get this to work no matter which environment variables I set. So I simply put a copy of the JDK into my Android Studio installation folder.
Copy the contents of the JDK installation (for example, C:\Program Files (x86)\Java\jdk1.7.0_21)
Paste them into the installation directory of the Android Studio (for example, C:\Program Files (x86)\Android\android-studio)
I somewhat assumed that the issue was caused by having the x64 version of the JDK installed. But what was especially confusing was the fact that I could start Android Studio just fine when I started the studio.bat as an Administrator (even though the environment variables were set for my personal user account).
studio.bat will look for several valid options when determining which JDK to use.
:: Locate a JDK installation directory which will be used to run the IDE.
:: Try (in order): ANDROID_STUDIO_JDK, ..\jre, JDK_HOME, JAVA_HOME.
As explained above, I picked the ..\jre option.
Today I found another situation when this problem occures - when you have several JDK, defined in JAVA_PATH. I have:
JAVA_HOME = C:\JAVA\JDK\jdk1.6.0_38;C:\JAVA\JDK\jdk1.7.0_10
So I received this problem with Android Studio setup
But when I've removed one of JDK - problem has been solved:
JAVA_HOME = C:\JAVA\JDK\jdk1.7.0_10
Installation wisard found my jdk and i had a nice night to study studio.
But unfortunatelly even installed studio doesn't work with several jdk.
Does anybody know how to fix it?
I hope I've helped someone
Add JAVA_HOME and JDK_HOME system environment variables.
Right-click
android studio (the 64 version if that's your OS and JDK) and go to
compatibility tab and set "Run as administrator" to true.
Run android studio and high-five me virtually when it works.
If that fails, try "where java" in cmd.exe. If it lists c:\system32\java.exe first, then rename the file and try again.
Windows 64 bit, JDK 64 bit (Solution that worked for me)
Tried all the above solutions, and None of them worked, I have been trying to solve it for the past few days and now I did it successfully. For me the problem was when I first installed Android Studio my JDK version was 1.7, then after installing I updated the JDK to 1.8, then I removed the old JDK folder and everything was messed up, even uninstalling and reinstalling android studio randomly didn't solve the issue.
Below is the solution that worked for me
Uninstall Android Studio.
clean temp files and android studio C:\Users\Username.AndroidStudio1.5
Uninstall JDK.
Now without JDK try to install Android Studio and now it will show the message that it can't find any JDK. Stop installation
Install JDK 1.7 or 1.8 (Set JAVA_HOME, JDK_HOME, path Environment variables as explained by everybody above)
Install Android Studio.
Done. Enjoy and happy coding.
MAKE SURE YOU RESTART ANDROID STUDIO
Even though I should know better and swear I did, make sure you restart studio after making these changes as it clearly does not check them on every build (which to me makes sense that system/user variables should only be read once on startup)
Anyway, yea... Make sure you restart after you make these changes.
Path = to the bin folder in the jdk folder (path already exists)
JAVA_HOME = to the jdk folder
Install the latest JDK in your system from JDK 7 and JRE 7 Installation Guide.
JAVA_HOME -> C:\Program Files\Java\jdk1.7.0_4
path -> C:\Program Files\Java\jdk1.7.0_4\bin
If setting the JAVA_HOME variable doesn't work for you, set:
STUDIO_JDK=C:\Progra~1\Java\jdk1.8.0_172
Where the path points to your JDK installation
This is the only thing which works for me in Windows 32bit with Android 10 and up.
In my experience, I was unable (even after adding JDK_HOME) to launch Studio via either the shortcut or studio.exe itself. I had to first run bin/studio.bat (mentioned in the original question).
After the first successful launch, I'm able to start it with the shortcut.
If you have a 64 bit windows OS, pointing the JAVA_HOME system variable to
C:\Program Files (x86)\Java\jdk1.7.0_21
Will work when
C:\Program Files\Java\jdk1.7.0_21
fails to work.
You need 1.7 JDK installed on your system. Add a system variable with:
name: ANDROID_STUDIO_JDK
path: your JDK path (for example, C:\Program Files\Java\jdk1.7.0_21)
See more at FIX: Android Studio - Installation Issues on Windows 7 | ERROR: cannot start Android Studio. No JDK found.
TRY TO INSTALL 32BIT JDK
if you have jdk installed and had set up the System Varibles such as JAVA_HOME or JDK_HOME
and tried click back and then next ,you might have installed the 64bit JDK,just download the 32bit jdk and install it.
I downloaded the latest jdk version
JAVA_HOME to C:\Program Files\Java\jdk1.8.0_11\bin
Set the PATH to C:\Program Files\Java\jdk1.8.0_11\bin
I restarted the STUDIO and it worked.
On Windows 10, restarting the installer and running as admin worked for me.
To complete this stack of possible solutions: For me the problem was, that I did not execute the Android-Studio-Setup as administrator. Running it as administrator then made me able to install Android-Studio.
For me, the problem was that I had changed the GC vm arg to -XX:+UseParallelGC in the C:\Users\<username>\.AndroidStudio2.1\studio64.exe.vmoptions file. That's what I use in Eclipse and I was trying various things to get AndroidStudio half way as efficent as Eclipse. I restored the GC to -XX:+UseConcMarkSweepGC.
The answer to the original question is that, might be you are opening android studio from 32 bit shortcut icon of android studio, try to open from icon "studio64" located under .../bin/ where android studio setup is install.
In case you had it running but Now it doesn't Launch.
I deleted the C:\Users\<NAME>\.AndroidStudio<version>\ folder and it worked.

Eclipse error: invalid path for ndk?

I want to integrate some c code with Android so as first step I has to specify NDK path in Native Development node. But when I specify NDK path it gives error Invalid path for NDK
I googled but could not find some solution. Am I missing some step.
SDK and NDK are in the same folder and SDK path working fine.
Please help
I have installed
make-3.81
nawk-2007.10.23-setup
Cygwin
ADT-17.0.0
Sequoyah
android-ndk-r7b-windows.zip (Extracted)
EDIt:
I just check the link and came to know that it could be GCC absent problem .How do I check that if its GCC problem or not , or How can I check if GCC is installed or not?
Mmm... weird error. Keep in mind that in order to use the NDK, the SDK should be working in perfect way before you start with the NDK, said that, I suggest you to try the following:
1- Be sure you have the pre-requisites:
For all development platforms, GNU Make 3.81 or later is required.
Earlier versions of GNU Make might work but have not been tested.
A recent version of awk (either GNU Awk or Nawk) is also required.
For Windows, Cygwin 1.7 or higher is required. The NDK will not work
with Cygwin 1.5 installations.
2- Start from scratch again by deleting any NDK references such as the settings on eclipse, paths, folders, zips, etc.
3- Be sure you have updated to the latest Android SDK and ADT Tools. Using the Help->Check for Updates Menu in ECLIPSE and then be sure you have all the things are up to date on the Android SDK Manager.
4- I see a "D:/" on your question, so you're using a Windows PC... it must be a Windows XP (32-bit) or Vista (32- or 64-bit). Be sure to get the Windows version (http://dl.google.com/android/ndk/android-ndk-r7b-windows.zip), and when you have unzipped that ndk, rename the folder to "ndk". You can put it next to where your SDK's folder is, it should not matter.
5- Open Eclipse, and give it the path to the NDK, and see what happens.
Good luck!
I exhuasted to solve this problem "Invalid path for android SDK" but it got solved at last.
Here is how it got solved.
My system specs: P4 3.2 GHz, Windows 7 32-bit, Eclipse Standard Edition 4.3 (Kepler).
Other supporting softwares: MinGW with GNU make 3.81.
Problem (first the problem I faced and then the solution):
I downloaded Android NDK latest version from "developer.android.com/sdk/ndk/index.html" which was "android-ndk-r9-windows-x86.zip". Then I extracted it in C:\ directory then I added a ";C:\android-ndk-r9" in my PATH variable. Then I installed "Sequoyah Android Native Code Support" using eclipse "install new software" option (Help ➤ Install New Software➤type "Indigo - http://download.eclipse.org/releases/indigo" in the work with field ➤ go to Mobile and Device Development category and select Sequoyah Android Native Code Support).
Then I went to eclipse menu "Window ➤ Preferences ➤ Android ➤ Native Development" and entered "C:\android-ndk-r9" in the NDK location and got error " Invalid path for NDK".
Solution: I search exhaustively on internet and tried different solution but the solution worked for me was:
I downloaded the older version of NDK ( download link: "dl.google.com/android/ndk/android-ndk-r7c-windows.zip" ) and extracted in C:\ directory using winrar and updated the PATH in environment variable to point to the new NDK version 7c. When now I entered the path it accepted. No error appeared.
the problem is Sequoyah doesn't accept new version because it has not updated since 2011 ( I'm not sure)
Note1: for Linux users download link: "dl.google.com/android/ndk/android-ndk-r7b-darwin-x86.tar.bz2"
Note2: you can change the version in the link according to your requirement for example "dl.google.com/android/ndk/android-ndk-r4bc-windows.zip" to download version 4b.
Thanks.
Try to create a new systems variable called "NDK" and set its value to the NDK path.
Check your path to the NDK-- this has, on more than one occasion been the issue for me, at least with the SDK. (Not NDK in my instance) I know that, for instance, at the moment my NDK path is ~/android-ndk-r6/android-ndk-r6/
Also, to install gcc in windows, you must install Cygwin or such compatible gcc setup for windows. (The docs here say that it is required, but I think I may have heard of people using some slightly different implementation.) Cygwin works well for me, but you may need to specify gcc, make, and so on, in the installer as packages to be downloaded and set up on your machine, so read your installation options carefully. If you find that you have more packages that need to be installed, you can run the setup.exe program again and install them in-place.
In addition, here (at the bottom of the page) you can find an installation guide for the NDK in case you run into further issues.
Hope some file is missing in your ndk folder, so that it is unable to identify the ndk folder. Download ndk again and load it, otherwise update the native development plugin...
You said SDK and NDK are in same folder. It could be a conflict with the route. Try this:
Uninstall NDK
Reinstall NDK at D:\ecpspace\NDK\android-ndk-r7b
Create new PATH on enviroment var
Restart computer
On linux work for me, i had 2 ndks installed in different routes, and when i used eclipse, was compiling using the other one, and don't worked as i wanted.
This might sound dumb, but did you download the correct package? I had the same problem on linux until I realized I was trying to use the Windows version (I had downloaded it earlier while I was trying to install it on a different computer with cygwin). I downloaded the linux package and everything worked.
I've only been at this for a couple of days, but in my brief experience, the NDK and eclipse do not play well together. I would suggest moving to the command line for the NDK portion of the project for the time being. Some good tutorials can be found at:
http://www.cmumobileapps.com/2011/08/31/compiling-open-source-libraries-with-android-ndk-part-1/
http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/
I have similar bug (Eclipse Version: Indigo Service Release 2, Build id: 20120216-1857). The main problem was in Sequoya plug-in. Problem disappear when I update Sequoya to the latest version.

Categories

Resources