I am trying to run the draw9patch.bat from my cmd but it throws the following error.
WARNING: Java not found in your path.
Checking if it's installed in C:\Program Files\Java instead (64-bit).
Checking if it's installed in C:\Program Files\Java instead.
ERROR: No suitable Java found. In order to properly use the Android Developer
Tools, you need a suitable version of Java JDK installed on your system.
We recommend that you install the JDK version of JavaSE, available here:
http://www.oracle.com/technetwork/java/javase/downloads
You can find the complete Android SDK requirements here:
http://developer.android.com/sdk/requirements.html
I have java installed and have also tried changing the classpath from environment variables in the control panel.However it does not seem to solve the problem.What am i doing wrong.
For that you need to set the 'path' environment variable.
Something like this:
path=%path%;c:\program files\java\jdk 1.6\bin
or
the path where you have installed the java.
You may need the swing-worker-1.1.jar, place this in Android-sdk/tools/lib directory.
For people who are looking for solution for Windows 7 (maybe for xp too) and that last answers wasn't the right solution.
If you have problem with running this file, this problem will happens in almost all .bat files in android-sdks/tools files.
Here is what to do and all that batch files will work okay.
I assume that you have downloaded proper JDK so..
Go to folder android-sdks\tools\lib and edit file find_java.bat
Delete all text stored inside and insert into something like that:
set java_exe="C:\Program Files\Java\jre7\bin\java.exe"
if not defined java_exe goto :CheckFailed
:SearchJavaW
set javaw_exe="C:\Program Files\Java\jre7\bin\javaw.exe"
if not exist %javaw_exe% set javaw_exe=%java_exe%
goto :EOF
Please be carefull and put correct path to jre what you have! Here is an example for jre7!
Related
I've been able to install ionic and create the necessary files for the app by "$ionic start myApp tabs" but when i tried to build the app "ionic platform add android"
i'm getting this error http://i.stack.imgur.com/P4HDQ.png
I've looked online for any solutions and found some with no luck
You will need to go to your environment variables and update the below to your path.
android-sdk\platform-tools
android-sdk\tools
apache-ant-1.9.4\bin
jdk1.8.0_31\bin
Depending on your OS, for windows 8 the quickest way to get to the window to edit your path is by clicking the windows key on your keyboard and searching environment variables. The first item in the list, "edit environment variables for your account" is correct. Make sure you add the full path of each of the above.
Your PATH variable should look something like this...
C:\Users[user]\AppData\Local\Android\android-sdk\platform-tools;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\Users[user]\AppData\Local\Android\android-sdk\tools;C:\Users[user]\Documents\Development\sdks\apache-ant-1.9.4\bin;%JAVA_HOME%\bin;C:\Users[user]\AppData\Roaming\npm
Where I have %JAVA_HOME% I have simply named a new variable JAVA_HOME which has the following path...
C:\Program Files\Java\jdk1.8.0_31
I did this simply to make the string of text in PATH shorter. You can just replace, where I have %JAVA_HOME%, with C:\Program Files\Java\jdk1.8.0_31 or where ever your path to jdk1.8.0_31 .
Please make sure that you put in the correct path that is relevent to where you have each of these and don't copy what I have above as this will not work for you.
I had to install an updated version of Java RE. My installed version of eclipse complained that it couldn't find it. This eclipse came with a complete ADT download. The specific error message was that it couldn't find javaw.exe in the eclipse\jre\bin sub-directory of the adt-bundle directory. I copied javaw.exe to that sub directory. This time Eclipse tried to start, but came back with an Error code 13 and a long list of stuff that wasn't very enlightening. Please help.
just reinstall JDK 32/64-bit, re-extact eclipse-32/64bit and edit eclipse.ini again
Check your eclipse.ini file and see if following required are well written :
Note:
the format of the -vm option - it is important to be exact:
1. The -vm option and its value (the path) must be on separate lines.
2. The value must be the full absolute or relative path to the Java executable, not just to the Java home directory.
3. The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.
Check this link for reference.
And also this link
Hope this will help.
Make sure to download JDK and JRE from:-
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Also create PATH enviroment variable on you computer like this:
Right click on My Computer > Properties > Advanced > Enviroment variables > New ( Variable name: PATH Variable value : C:\Program Files\Java\jdk1.7.0_06\bin (Where you installed Java)) > Click OK! Done
I hope this helps. Good luck!
I downloaded the JDK again and re-installed it and re-transferred the javaw.exe to the sub directory where Eclipse wanted it (...\eclipse\jre\bin) and it worked fine. My previous download of the JDK must have been somehow corrupted
I have seen this same thing posted quite a few times, but whenever I try to import my project to my new work laptop I keep getting this error.
I have pulled the project from git (which his btw running fine on my old laptop).
Then I went to the sdk manager, downloaded all the tools, and all the SDK's available.
In the welcome screen, I went to Configure -> project Defaults -> Project structure.
Android SDK Tab says the path for projects without local.properties will be /Applications/Android Studio.app/sdk
This is correct.
Under SDKs I have all the available SDK's visible.
Project SDK is set to API 18
Yet still I get this error when trying to build my project.
Can anyone tell me where I havent looked yet?
I am running gradle 1.7 when trying to build which is downloaded from services.gradle.org
I had very similar situation (had a project on another machine and cloned it to my laptop and saw the same issue) and I looked in it.
Error message was coming from Sdk.groovy of Android gradle plugin:
https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/internal/Sdk.groovy
By looking at code, its findLocation needs to set androidSdkDir variable and there are only three ways to do it:
create local.properties file and have either sdk.dir or android.dir line.
have ANDROID_HOME environment variable defined.
System.getProperty("android.home") - I'm not sure how it works, but it seems like a Java thing.
While your Android Studio knows that the SDK is at that place, I doubt that Android Studio is passing that information to gradle and thus we're seeing that error.
I created local.properties file at the project root and put the following line and it compiled the code successfully.
sdk.dir = /Applications/Android Studio.app/sdk/
creating local.properties file in the root directory solved my issue
I somehow lost this file after pulling from GitHub
this is how my local.properties file looks like now:
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Sat Feb 06 11:53:03 EST 2016
sdk.dir=/Users/****/Library/Android/sdk
I found the solution here:
http://xinyustudio.wordpress.com/2014/07/02/gradle-sdk-location-not-found-the-problem-and-solution/
Just create a file local.properties and add a line with sdk.dir=SDK_LOCATION
If none of the answers work for you which happened to me on macbook pro in one of the projects you can always try to run Android Studio with an alias command passing sdk.dir with each run:
alias studio='launchctl setenv ANDROID_HOME '\''/Users/username/Library/Android/sdk'\'' && open -a '\''Android Studio'\'''
To fix this problem, I had to define the ANDROID_HOME environment variable in the Windows OS.
To do this, I went to the System control panel.
I selected "Advanced system settings" in the left column.
On the "Advanced" tab, I selected "Environment Variables" at the bottom.
Here, I did not have an ANDROID_HOME variable defined. For this case, I selected "New..." and:
1) for "Variable name" I typed ANDROID_HOME,
2) for "Variable value", I typed the path to my SDK folder, e.g. "C:\...\AppData\Local\Android\sdk".
I then closed Android Studio and reopened, and everything worked.
Thanks to Dibish (https://stackoverflow.com/users/2244411/dibish) for one of his posts that gave me this idea.
Had the same problem in IntelliJ 12, even though I have ANDROID_HOME env variable it still gives the same error. I ended up creating local.properties file under the root of my project (my project has a main project w/ a few submodules in its own directories). This solved the error.
specifying sdk.dir=<SDK_PATH> in local.properties in root folder solved my problem.
I clone libgdx demo, can't import project. it also reminds like this.
Env:
Eclipse(Android-ADT)
window 7
so I create local.properties file at the project root, like following
sdk.dir = D:/adt-bundle-windows-x86/sdk
I hope this can help others!
Copy and paste the local.properties file from a project you created on your new computer to the folder containing the project from your old computer also works too if you don't want to (or know how to) create a new local.properties file.
I noticed that I get this error when I'm working on a new computer if I try to build from the command line first. However, if I build from Android Studio, it retrieves the SDK and creates the directory automatically. Then when I build from the command line it works.
You have also to ensure you have the correct SDK platform version installed in your environment by using SDK Manager.
If you have cloned a project from GitHub for example, and you've tried the methods mentioned here without success including:
Editing sdk.dir in the local.properties
Trying to set ANDROID_HOME environment variable
Or adding an alias as kasiara mentioned
You should try to see if you are trying to build a directory project that is a part within a bigger project, and so it may cause problems.
So load the entire project, and then run the project directory you'd like.
In my specific case I tried to create a React Native app using the react-native init installation process, when I encountered the discussed problem.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\Users\***\android\local.properties'.
I add this, because when developing an android app using react native, the 'root directory' to which so many answers refer, is actually the root of the android folder (and not the project's root folder, where App.js resides). This is also made clear by the directory marked in the error message.
To solve it, just add a local.properties file to the android folder, and type:
sdk.dir=C:/Users/{user name}/AppData/Local/Android/Sdk
Be sure to add the local disk's reference ('C:/'), because it did not work otherwise in my case.
I have downloaded and installed Android SDK and tried to start android.bat sdk but got following exception:
C:\products\Android\tools>android.bat sdk
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3550 or swt-win32 in swt.library.path,
java.library.path or the jar file
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:328)
at com.android.sdkmanager.Main.doAction(Main.java:302)
at com.android.sdkmanager.Main.run(Main.java:118)
at com.android.sdkmanager.Main.main(Main.java:101)
I have searched for solution a long time but I cannot get it to work. Is there anything I have to set up first?
Just in case this is still bothering anyone: I had this same problem. What I ended up doing was:
Searching for the swt.jar file (in your Android SDK directory, look at tools\lib\x86 or tools\lib\x86_64).
Unpack it using jar:
mkdir tmp
cd tmp
jar xf <path>\tools\lib\x86\swt.jar
Copy the dlls to the tools folder.
copy tmp\*.dll <path>\tools
After that I was able to run the SDK manager.
This works for me:
Add the following in your android.bat file:
-Dswt.library.path = {swt.jar folder path}
before this phrase:
com.android.manager.Main
Run android.bat
I think the jar file is not placed in correct place.
SWT consists of two "parts" - the platform independent java-only part
and a platform dependent fragment. Did you add the platform dependent
fragment too?So you need
org.eclipse.swt_VERSION.jar
org.eclipse.swt_WINDOWSYSTEM_PLATFORM_VERSION.jar
Refer this link for Setting the class path.
SWT Programming with Eclipse.
I had the same message displayed in the eclipse console when I was trying to load the sdk manager from within eclipse. All you need to do to fix it is run eclipse as administrator and it should work fine
Change the path to swt.jar.
edit "[your sdk_path]\tools\android.bat" file.
find words "%Swt_path%\swt.jar"
Find your Eclipse plugin folder path.
be replace path by [your eclipse\plugins\swt.jar]
example
before classpath "% jar_path%;% swt_path%\swt.jar"
after classpath "% jar_path%; C:\eclipse\plugins\ org.eclipse.swt.win32.win32.x86_3.102.1.v20130827-2048.jar"
I hope this will help resolve the way.
This questions its rather old, but I ran with the same issue as today, in 2015.
Also I expected the answers may not work, but oriented me to get this running without the need of running as Administrator, specially "Mehdi golnari" answer.
Based on Mehdi answer, we need add the same parameter that he added, but updated to work on the new SDK Tools (or android SDK). Mine is revision 24.3.3, SDK , so the com.android.manager.Main will not longer work for me, but insted we need it to be com.android.sdkmanager.Main.
Also we can use the variable that was set in the same bat before: %swt_path%.
So, add the following, almost at the end of the android.bat file:
"-Dswt.library.path=%swt_path%"
The resulting call code, should be a single line like this:
call "%java_exe% %REMOTE_DEBUG%" "-Dcom.android.sdkmanager.toolsdir=%tools_dir%" "-Dcom.android.sdkmanager.workdir=%work_dir%" -classpath "%jar_path%;%swt_path%\swt.jar" "-Dswt.library.path=%swt_path%" com.android.sdkmanager.Main %*
This should help to run the android.bat, SDK Manager.exe, and AVD Manager.exe without run as Administrator needs.
I have a problem about Unable to access jarfile ..\lib\proguard.jar when run Export Singed Application Package from IntelliJ 11.1.
Environment:
Run proguard is success in Android SDK r16.
Run proguard is failed in Android SDK r17.
The problem is IntelliJ setting error or IntelliJ 11 bug?
Edit $ANDROID_SDK\tools\proguard\bin\proguard.bat and set absolute path to PROGUARD_HOME
May look like this:
SET PROGUARD_HOME="c:\android-sdk\tools\proguard"
java -jar "%PROGUARD_HOME%"\lib\proguard.jar %*
This issue can also come up if you have a space anywhere in your Android SDK path. The solution is to modify $ANDROID_SDK\tools\proguard\bin\proguard.sh. Change this last line:
java -jar $PROGUARD_HOME/lib/proguard.jar "$#"
to
java -jar "$PROGUARD_HOME/lib/proguard.jar" "$#"
On Mac:
/Applications/Android Studio.app/sdk/tools/proguard/bin/proguard.sh
Change this last line:
java -jar $PROGUARD_HOME/lib/proguard.jar "$#"
to
java -jar "$PROGUARD_HOME/lib/proguard.jar" "$#"
The reason why it happened for me on my Windows machine was because I moved the location of the Android SDK in my file system but I didn't update my PROGUARD_HOME system variable. The PROGUARD_HOME system variable is referenced in the {android-sdk}\tools\proguard\bin\project.bat file.
Extra Info:
The value of my PROGUARD_HOME system variable was set as a path within my old Android SDK directory. I shouldn't experience this in future because I've now created an ANDROID_HOME system variable which points to my Android SDK and my PROGUARD_HOME system variable is now defined as follows:
%ANDROID_HOME%\tools\proguard
All I have to do in future if I relocate my Android SDK in future is update my ANDROID_HOME system variable.
This issue has been occurred after I had updated tools (26.6.2)+ migrating to win7 from xp.
The possible reason perhaps in proguard place because some folders can have a space in their path folders' names(like "Program Files",e.g.).
In my case i did what has been pointed above but copied the entire proguard folder to new place (mine new became "c:\proguard") and put its path to PROGUARD_HOME
SET PROGUARD_HOME="c:\proguard"
in $ANDROID_SDK\tools\proguard\bin\proguard.bat file.
Another possible way:
After tools upgrading i found very simple solution:
find environment variable
PROGARD_HOME on windows
and edit its path to
(in mine case ,currently) :
not C:\Program Files\Android\android-sdk\tools\proguard
but "C:\Program Files\Android\android-sdk\tools\proguard"