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.
Related
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 am running through this tutorial:
http://docs.phonegap.com/en/2.9.0/guide_getting-started_android_index.md.html#Android%20Platform%20Guide
I just created the project within my workspace with:
cordova create hello2 com.example.hello2 "Hello World 2"
cd into the dir
And now:
cordova platform add android
Gives me the following error:
The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added to your path. Output: /bin/sh: android: command not found
My export path looks like this:
export PATH=${PATH}:/Documents/DevFolder/adt-bundle-mac-x86_64-20130522/sdk/platform-tools:/Documents/DevFolder/adt-bundle-mac-x86_64-20130522/sdk/tools
What's wrong with this path ?
Or what else could cause this error. And, yes I did install the Android SDK.
According to this:
http://developer.android.com/sdk/installing/bundle.html
As stated in the comments, the problem is related to the way the PATH to the android executable was defined. It is necessary to define these paths as absolute.
As for the Object has no method 'tmpDir' error, a quick google search revealed the following remedy: https://groups.google.com/forum/#!msg/phonegap/sKQ3MRrIpNg/dV6WYOTDDf0J
It's an old thread, but thought I'd mention this... You have to open a new terminal window AFTER adding the export path in ~/.bash_profile - then "cordova platform add android" worked. :)
this one worked for me
A - open the file /Users//.bash_profile (for example running from that folder, the command vim .bash_profile... or simply from finder, finding the hidden file and opening it with a text editor)
B - add the following line make sure to adapt it to your ADT folder name and position (in my case I placed the original adt-bundle-mac-x86_64-xxxxx folder into Application and renamed it ADT)
export PATH=/Applications/ADT/sdk/tools:/Applications/ADT/sdk/platform-tools:$PATH
making sure to add :$PATH at the end
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!
I am trying to make ndk-build to work within Cygwin on windows. As per the NDK documentation (specifically INSTALL.htm), "The NDK requires GNU Make 3.81 or later being available on your development."
I have Gnu Make installed on my computer.
So far, so good.
Within Cygwin bash, I cd over to the android NDK root directory. Now when I type in the following command (without parameters right now, just to see if the command works):
$./ndk-build
ERROR: Cannot find 'make' program. Please install Cygwin make package or define the GNUMAKE variable to point to it.
So I try to set the GNUMAKE variable, but no luck:
$export GNUMAKE='/cygdrive/c\Program Files\GnuWin32\bin'
ERROR: Your GNUMAKE variable is defined to an invalid name: /cygdrive/c\Program Files\GnuWin32\bin
Please fix it to point to a valid make executable (e.g. usr/bin/make)
I even tried setting it to usr/bin/make as it suggests, but same invalid name error.
Anyone, knows how to resolve this?
I'm using Windows 7, NDK r5, Cygwin 1.7.1
I had an issue with GNUMake when putting the ndk in a folder with a space in it (I originally put it in the program files directory). I moved everything to C:/android/android-ndk and C:/android/android-sdk and updated my path settings to include these directories.
Its not problem with the make but installing cygwin
in ndk-demo script the make path is found using which command mostly which command
installation is missing in cygwin.
Solution:
Relaunch your cygwin installation select utils (install )
Checking:
$ which make
should give you the make command path on cygwin prompt.
Regards,
Vasu
This is a generic error. It means there was a problem somehow with the make command, but the error message itself is hidden. To help diagnose the problem, open your ndk_build script in the ndk directory, and change these lines:
ABS_GNUMAKE=`which $GNUMAKE 2> /dev/null`
...
GNUMAKE=`which make 2> /dev/null`
to these:
ABS_GNUMAKE=`which $GNUMAKE`
...
GNUMAKE=`which make`
And then you will get a more detailed error message. Note that it might not even be a problem with the 'make' command, it might be a problem with the 'which' command. Make sure you have cygwin installed.
delete Environmental variable GNUMAKE
close the cygwin terminal
open again cygwin terminal... go the path where u want to build.. and now build it...
I am sure hopefully you will build successfully..as i do..
The answer with moving NDK to a directory without spaces is definitely right. After that you will probably able to run ndk-build from the Cygwin shell.
However running ndk-build from Windows commmand line (like "bash ndk-build") will probably cause the same queer error with "incorrect GNU make".
It is reproducible with NDK 6b as well.
And I hope it is fixed in the newest version of NDK...
ERROR: Cannot find 'make' program. Please install Cygwin make package
or define the GNUMAKE variable to point to it.
While trying to install Cygwin i missed out to install MAKE PACKAGE
Just need to search make in the Search box and it will shows the Branches that includes devel branch and from devel branch i selected make package.
That's all issue fixed.
i worked hard on error in gygwin terminal "gnumake variable is define to invalid name" and after that i get to the point that we simply remove this error by deleting the GNUMAKE path in environment variable both in system and user variable if u created it hope its helps....
mycomputer > system properties > advanced system setting > environment variable
The problem here is the name of the GNUMAKE variable.The name given was
/cygdrive/c\Program Files\GnuWin32\bin change it into /cygdrive/c/Program Files/GnuWin32/bin/make
only use forword Slash .Sometime the space in the folder structure does not taken
Happy coding.