The Android SDK doesn't open so i tried to open Android.bat to see the errors and I get this Error:
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
Error: Could not find or load main class com.android.sdkmanager.Main
Press any key to continue . . .
Here is my Environment Variables:
ANDROID_SWT: C:\adt-bundle-windows-x86\sdk\tools\lib\x86.
JAVA_HOME: C:\Program Files\Java\jdk1.7.0_25. JDK_HOME:
C:\Program Files\Java\jdk1.7.0_25. PATH:(Sorted that it will be
Readable)
C:\Python33\; %SystemRoot%\system32; %SystemRoot%;
%SystemRoot%\System32\Wbem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\; C:\Program
Files\Microsoft Network Monitor 3\;
C:\adt-bundle-windows-x86\sdk\platform-tools;
C:\adt-bundle-windows-x86\sdk\tools;C:\PHP; C:\Program
Files\TortoiseSVN\bin; C:\Program Files\Microsoft SQL
Server\110\Tools\Binn\; C:\Program Files\Microsoft Visual Studio
11.0\VC\bin; C:\Program Files\OpenVPN\bin.
I searched the whole web and i couldn't find any answer, i would like if you will help me to fix it.
Thanks!
Taken from the possibly duplicated thread:
The latest SDK has AVD Manager in the SDK Manager itself. Open SDK
Manager -> Tools -> Manage AVDs
Did you try installing the JDK outside Program Files? That is install it in a directory, which does not have any spaces in the path. For example install the JDK in the following directory and try again
c:\installs\java
Make Sdk update to repair the sdk bundle and try making some
avds
Your JAVA_HOME might be configured wrongly. Trying changing the path to C:\Program Files\Java\jdk1.7.0_25\jre\bin
Related
I have all set up .
I have installed android sdk api 24 and all the necessary tools. I have also tried reinstalling ionic and cordova but it does not work.
This is the error log:
D:\Coursera\Course 4\myapp1\public>ionic platform add android
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: com.ionicframework.myapp1409522
Name: myapp1
Activity: MainActivity
Android target: android-24
Subproject Path: CordovaLib
Android project created with cordova-android#6.0.0
Installing "cordova-plugin-console" for android
Failed to install 'cordova-plugin-console':Error: cmd: Command failed with exit
code ENOENT
at ChildProcess.whenDone (C:\Users\Sahib\AppData\Roaming\npm\node_modules\co
rdova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitOne (events.js:96:13)
at ChildProcess.emit (events.js:188:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:213:12)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Error: cmd: Command failed with exit code ENOENT
I think you are not adding environment variable.
Please go through following steps :
Windows users developing for Android: You'll want to make sure you have the following installed and set up.
NOTE: Whenever you make changes to the PATH, or any other environment variable, you'll need to restart or open a new tab in your shell program for the PATH change to take effect.
Java JDK
Install the most recent Java JDK (NOT just the JRE).
Next, create an environment variable for JAVA_HOME pointing to the root folder where the Java JDK was installed. So, if you installed the JDK into C:\Program Files\Java\jdk7, set JAVA_HOME to be this path. After that, add the JDK's bin directory to the PATH variable as well. Following the previous assumption, this should be either %JAVA_HOME%\bin or the full path C:\Program Files\Java\jdk7\bin
Apache Ant
To install Ant, download a zip from here, extract it, move the first folder in the zip to a safe place, and update your PATH to include the bin folder in that folder. For example, if you moved the Ant folder to c:/, you'd want to add this to your PATH: C:\apache-ant-1.9.2\bin.
Android SDK
Installing the Android SDK is also necessary. The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.
Cordova requires the ANDROID_HOME environment variable to be set. This should point to the [ANDROID_SDK_DIR]\android-sdk directory (for example c:\android\android-sdk).
Next, update your PATH to include the tools/ and platform-tools/ folder in that folder. So, using ANDROID_HOME, you would add both %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools.
For more please check here and here.
Hope this will help you !!
My final solution was to add the Environmentvariable:
_JAVA_OPTIONS: -Xmx512m
You may vary the 512m by your needs.
Most probably, you need to add "C:\Windows\System32" to your path variable.
I am downloaded Node.js and Apache Ant from Bitnami. And set Environmental Variables for the Android SDK, Java JDK, Apache ANT and for NODE.js.
I have checked the PATH by echo %PATH% command in CMD and it results as
C:\ProgramData\Oracle\Java\javapath;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files (x86)\Windows Live\Shared;
C:\Program Files(x86)\WinSCP\;
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;
C:\Program Files\Java\jdk1.8.0_74\bin;
C:\Bitnami\apache-ant-1.9.2-bin\apache-ant-1.9.2;
C:\Softwares\android-sdk_r24.0.2-windows\android-sdk-windows\tools;
C:\Softwares\android-sdk_r24.0.2-windows\android-sdk-windows\platform-tools;
C:\Bitnami\nodejs-0.12.2-0;
But it always showing like this,
C:>npm -v
'npm' is not recognized as an internal or external command,
operable program or batch file.
Please suggest for fixing this.
Thanks
Found it.
The path for npm and cordova are present in nodejs\node_modules folder. So refer all paths from use_nodejs file. Please follow the steps.
Open the Command Prompt from Windows. And type C:\>set. From this you can get all system Variables and paths.
Open the use_nodejs which is the windows batch file from C:\xxx\Bitnami\nodejs-0.12.2-0 and type C:\>set, from this you can get all system Variables and paths but which is looking different.
Compare the variables and paths from both command prompt and you can get ideas of paths.
Change the path in Windows Command Prompt like setx NODE_HOME "C:\Bitnami\nodejs-0.12.2-0\nodejs\node_modules" from the use_nodejs command promt paths. Like this change whatever paths you want to add.
I ran
cordova platform add android
and the error I got
Running command: "c:\Program Files\nodejs\node.exe" "d:\Users\Andy\Project
s\ionic-tut\hooks\before_platform_add\init_directories.js" "d:/Users/Andy/
Projects/ionic-tut"
Creating android project...
D:\Users\Andy\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\nod
e_modules\q\q.js:126
throw e;
^
Error: ANDROID_HOME is not set and "android" command not in your PATH. You must
fulfill at least one of these conditions.
I ran this from git bash
on running it from cmd it throws a different error
Error: Please install Android target "android-19".
I ran a echo %PATH% to verify:
C:\ProgramData\Oracle\Java\javapath;
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
C:\Program Files (x86)\Intel\iCLS Client\;
C:\Program Files\Intel\iCLSClient\;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;
C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;
C:\Program Files\Intel\WiFi\bin\;
C:\Program Files\Common Files\Intel\WirelessCommon\;
C:\Program Files\Intel
\Intel(R) Management Engine Components\DAL;
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;
C:\HashiCorp\Vagrant\bin;
C:\Program Files\nodejs\;
D:\Users\Andy\AppData\Roaming\npm;C:/Program Files/nodejs/node.exe;
C:\Program FIles\Java\jdk1.8.0_31\bin;
C:\Program Files (x86)\Android\android-sdk\tools;C:\Program Files (x86)\Android\android-sdk\platform_tools
I feel like I am messing up the enviroment variables somewhere but I have checked it multiple times and it seems to be right.
What am I missing?
Windows 8.1
You will need to run the command android from CMD to open the android SDK manager.
From there make sure that the Android 4.4.2(19) package is installed. Let me know if this fixes your issue.
My sdk manager is not opening..when i try to open it from within eclipse it displays :
[2014-02-01 17:37:06 - SDK Manager] [SDK Manager] 'xcopy' is not recognized as an internal or external command,
[2014-02-01 17:37:06 - SDK Manager] [SDK Manager] operable program or batch file.
I had a problem opening eclipse itself but i solved it .. the problem was that sdk was searching for jre in the android sdk (eclipse) folder itself but it was in C:\program files\java\jre7 .So i copyed jre7 from there to eclipse folder and renamed it to jre..and eclipse started working....BUT THE SDK MANAGER DOES NOT START IT JUST FLASES FOR a sec.
Open sdk/tools/android.bat in notepad
set java.exe path in android.bat file
your java.exe path like that
set java_exe="C:\Program Files (x86)\Java\jre6\bin\java.exe" in android.bat file
Follow these steps and it help for me after a long time with all ways above not effect on windows7 64-bits, no need to have JAVA_HOME system variable or edit android.bat
Download Android Studio within Android SDK, Java JDK 64 bits and Java JRE x86
Install Java JRE first, then install Java JDK 64 bits, and the Android Studio last.
Now you start Android Studio first (64 bits version) it require to have JAVA_HOME setting to run JVM, just copy the jdk.x.x.x(version) folder (my PC: jdk1.8.0_25 from "C:\Program Files\Java\")folder to Android Studio folder and rename that folder (in Android Studio) to "jre" (jdk1.8.0_25 -> jre).
Now it work for me to open Android SDK Manager from anywhere, if you want to use eclipse (not official now) just copy the java jre.x.x.x(version) x86 folder (from where you install before) to Eclipse and rename to "jre". After coping, choose the Android SDK path in Eclipse to use, It works for both Android Studio and Eclipse.
Mind your antivirus if still refusing you (remove antivirus and install after you sure it not cause problem)!
1)go to sdk-tool-android.bat file and open it by right click then edit and then set java_exe path.Yo have to set path as in step 2
2)set java_exe=C:\Program Files\Java\jre7\bin\java.exe Location of your JRE may vary as might installed in other location
3)After doing this Run Android studio as administrator and also run your Eclipse as administrator
Then Have Fun..
If you face an "xcopy" problem please try running sdk/tools/android.bat as admin. If it still happens this may mean that there is a problem with proper reading of a relative path in the batch, and in order to solve it you can amend one line of the batch from "xcopy %swt_path% %tmp_dir%\%swt_path% /I /E /C /G /R /Y /Q > nul" to "C:\Windows\System32\xcopy %swt_path% %tmp_dir%\%swt_path% /I /E /C /G /R /Y /Q > nul"
I have installed the Android SDK but I can't get the Adroid SDK manager to open.
I have looked everywhere on the internet and this is what I have already done which didn't help:
1. run sdk as administrator
2. adding a path pointing to the JDK in all of these forms :
C:\Program Files\Java\jdk1.7.0_21\bin;%SystemRoot%\system32;
C:\Program Files\Java\jdk1.7.0_21\bin;
C:\Program Files\Java\jdk1.7.0_21\
C:\Program Files\Java\jdk1.7.0_21
C:/Program Files/Java/jdk1.7.0_21/bin;
none of them worked ..:-(
3.
Step #1: Open up a command prompt.
Step #2: Use the cd command to move to wherever you installed your Android SDK.
Step #3: Run tools\android.
after doing it I got an error message that said that :
ERROR: No suitable Java found. In order to properly use the Android Developer
Tools, you need a suitable version of Java installed on your system.
4. deleting 3 times the sdk and reinstalling it.
5. Deleting the .android folder from the user (C:/Users/[User Name]) directory
By the way I have Windows 7 , and I have downloaded the 64 -bits sdk.
I am so helpless.. I ll appreciate a lot a solution...
Shiran
I had the same problem. Try to add an environment variable :
JAVA_HOME : "C:\Java\jdk1.7.0_25\".
It solves problem for me.
WRT Ubuntu 14.04:
You may not have java installed globally in your machine. My fix was to do:
sudo apt-get install openjdk-7-jdk
After was I able to run the SDK Manager.