The error on the above title only occurs on this specific project, when I build a Blank project it doesn't get this error. I've tried the other solutions to this problem but I just can't seem to get this working.
Heres the error message:
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
ANDROID_HOME=C:\Users\ME\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_211
Running command: cmd "/s /c ""C:\Program Files (x86)\gradle-5.6.2\bin\gradle.bat" -p C:\Windows\System32\QRID2\qrid\platforms\android wrapper -b C:\Windows\System32\QRID2\qrid\platforms\android\wrapper.gradle""
Command finished with error code ENOENT: cmd /s /c ""C:\Program Files (x86)\gradle-5.6.2\bin\gradle.bat" -p C:\Windows\System32\QRID2\qrid\platforms\android wrapper -b C:\Windows\System32\QRID2\qrid\platforms\android\wrapper.gradle"
cmd: Command failed with exit code ENOENT
Error: cmd: Command failed with exit code ENOENT
at ChildProcess.whenDone (C:\Windows\System32\QRID2\qrid\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at ChildProcess.emit (events.js:198:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
This means ENOENT Error NO ENTity|ENTry so such derectory
check your gradle is located in C:\Program Files (x86)\gradle-5.6.2
Do you have the gradle installed on your machine?
Try it:
1 - download the gradle from the site gradle.org.
Download the .zip file and extract to disk C:\
2 - Set the Gradle Environment Variables.
In order for the Gradle executable to be visible on the Windows command line, you must set the GRADLE_HOME variable and expose it in the system path.
Example:
variable name: GRADLE_HOME
variable value: c:\gradle-2.5
and then add GRADLE_HOME to Path
;%GRADLE_HOME%\bin
Restart your PC and use de command line
gradle -version
To see if it works
Related
I'm confused. jdk,sdk,ant,cordova,ionic doing well,why builds error?
I searched everywhere,but no answer for it.
I guess has a error version?
who can help this?
system:win8
jdk:1.8
ant:1.96
android:22
%ANT_HOME%\bin\;%ANDROID_HOME%\platform-tools\;%ANDROID_HOME%\tools\;%java_home%\bin;%java_home%\jre\bin;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\
Path
E:\ionic\demo22>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" E:\ionic\demo22\hooks\after_
prepare\010_add_platform_class.js E:\ionic\demo22
add to body class: platform-android
Running command: cmd "/s /c "E:\ionic\demo22\platforms\android\cordova\build.bat
""
ANDROID_HOME=E:\adt-bundle-windows-x86_64-20140702\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_60
Running: E:\ionic\demo22\platforms\android\gradlew cdvBuildDebug -b E:\ionic\dem
o22\platforms\android\build.gradle -Dorg.gradle.daemon=true
Unzipping C:\Users\cxt\.gradle\wrapper\dists\gradle-2.2.1-all\2m8005s69iu8v0oiej
fej094b\gradle-2.2.1-all.zip to C:\Users\cxt\.gradle\wrapper\dists\gradle-2.2.1-
all\2m8005s69iu8v0oiejfej094b
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipExceptio
n: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:65)
... 3 more
E:\ionic\demo22\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "E:\ionic\demo22\platforms\androi
d\gradlew cdvBuildDebug -b E:\ionic\demo22\platforms\android\build.gradle -Dorg.
gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\cxt\AppData\Roaming\npm\node_modules\cord
ova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Error
I hope that not too late, but I had the same error and. So, I fixed it doing the next:
In your case find this:
C:\Users\cxt\.gradle\wrapper\dists\gradle-2.2.1-
all\2m8005s69iu8v0oiejfej094b
now you are here to delete the gradle-2.2.1-all.zip because this file is corrupted and then replace the file with this http://services.gradle.org/distributions/gradle-2.2.1-all.zip
when you finish all try again
ionic build android
Good Luck!
First of all you have to install
node.js
apache ANT
JDK & JRE
Android SDK & Eclipse
After installation, you have to set software paths into environmental- variable. Then fire your npm install -g cordova. Without this PhoneGap will not be created.
If still you have any confusion or question related to software installation then tell me.
I had the same issue on Mac.
The steps below solved that for me:
NOTE: gradle path & version would be different on your machine. please replace those informations with yours. you can get them from exception message
Download : http://services.gradle.org/distributions/gradle-2.13-all.zip
Get List of files in directory
sudo ls rm /var/root/.gradle/wrapper/dists/gradle-2.13-all/7hsc6vr6mi3i6i5m7q9hj4ci1q
Remove existing zip file
sudo rm /var/root/.gradle/wrapper/dists/gradle-2.13-all/7hsc6vr6mi3i6i5m7q9hj4ci1q/gradle-2.13-all.zip
If there is a *.zip.lck file, you'd better remove that too..
sudo rm /var/root/.gradle/wrapper/dists/gradle-2.13-all/7hsc6vr6mi3i6i5m7q9hj4ci1q/gradle-2.13-all.zip.lck
Copy downloaded file to that path
sudo cp /Downloads/gradle-2.13-all.zip /var/root/.gradle/wrapper/dists/gradle-2.13-all/7hsc6vr6mi3i6i5m7q9hj4ci1q/
Then try to run
ionic run android
hello
I am trying to build hybrid app with ionic and cordova
at first i run below commands and they run successfully
but after running the last command i get this error
ionic start firtApp
cd firtApp
ionic platform add android
note: it return me android-21 error, and i changed the android-21 to android-18, and it runs successfully
ionic build android
after running the above command i got this error
BUILD FAILED
D:\New folder\android-sdk-final\android-sdk-fully\sdk\tools\ant\build.xml:601: T
he following error occurred while executing this line:
D:\New folder\android-sdk-final\android-sdk-fully\sdk\tools\ant\build.xml:542: U
nable to resolve project target 'android-21'
Total time: 1 second
C:\Users\Mohammad\firstapp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "ant debug -f C:\Users\Mohammad\f
irstapp\platforms\android\build.xml -Dout.dir=ant-build -Dgen.absolute.dir=ant-g
en"
ERROR building one of the platforms: Error: C:\Users\Mohammad\firstapp\platforms
\android\cordova\build.bat: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: C:\Users\Mohammad\firstapp\platforms\android\cordova\build.bat: Command f
ailed with exit code 8
at ChildProcess.whenDone (C:\Users\Mohammad\AppData\Roaming\npm\node_modules
\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
please help me with this error
i really like to bulid hybrid apps with my web knowledge
thanks.
You can try this
Go to this directory
C:\Users\Mohammad\.cordova\lib\npm_cache\cordova-android\3.6.4\package\framework
Edit project.properties file. Change target to 19.
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-19
apk-configurations=
renderscript.opt.level=O0
android.library=true
Restart your terminal.
You don't have SDK correctly installed on you computer. (Path or SDK update)
It's write on your error log : You may not have the required environment or OS to build this project
you just need to install ant
sudo apt-get install ant
then do the same as before,its work correctly
I'm using Ubuntu 14.04. I'm following the steps given in http://chrislarson.me/blog/how-use-cordova-ubuntu-build-android-apps.html
to build my first app for Android on Ubuntu.
But when I run this: cordova platform add android, I get the following message on the terminal:
Error: EACCES, open
'/home/a/.cordova/lib/npm_cache/cordova-android/3.6.4/package/.npmignore'
If i try running sudo cordova platform add android, I get
Creating android project...
/home/a/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_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.
at /home/a/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:159:19
at _fulfilled (/home/a/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/a/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/a/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:760:13)
at /home/a/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:821:14
at flush (/home/a/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:442:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:929:3
Error: /home/a/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
try deleting the contents of
.cordova/lib/npm_cache/cordova-android/
and then try again.
cordova / npm cache cordova-android files deleting these will ensure a clean install.
first check your android path by echo $ANDROID_HOME
then if it is showing path then you have set ANDROID_HOME path correctly and
if not then do this
1) sudo gedit ~/.bashrc
2) then paste following path at the last of file save it and close.
export ANDROID_HOME=your_sdk_path/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
your first error is permission issue and second because ANDROID_HOME path not set correctly
I am on Windows 8 and following through how to install and use Cordova with Ionic Framework on Windows 8.1. I followed through the video here: http://learn.ionicframework.com/videos/windows-android/. I am stuck at 5:58 of the video where the SDK Manager is suppose to come up when I type 'android' in the command line, but it says it's unrecognizable command. I made sure my file directories are exact. What else am I missing? How do I fix this problem?
PATH
C:\Users\Jaime\AppData\Roaming\npm; C:\Program Files\Java\jdk1.8.0_25\bin; C:\Development\AndroidSDK\sdk\platform-tools; C:\Development\AndroidSDK\sdk\tools; C:\Development\ApacheAnt\bin; C:\Program Files\nodejs
Thanks!
Problem with Android command:
C:\Users\Jaime\myapp>ionic platform add android
npm http GET https://registry.npmjs.org/cordova-android/3.6.4
npm http 200 https://registry.npmjs.org/cordova-android/3.6.4
npm http GET https://registry.npmjs.org/cordova-android/-/cordova-android-3.6.4.
tgz
npm http 200 https://registry.npmjs.org/cordova-android/-/cordova-android-3.6.4.
tgz
Creating android project...
C:\Users\Jaime\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_mod
ules\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.
at C:\Users\Jaime\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\l
ib\check_reqs.js:159:19
at _fulfilled (C:\Users\Jaime\.cordova\lib\npm_cache\cordova-android\3.6.4\p
ackage\bin\node_modules\q\q.js:798:54)
at self.promiseDispatch.done (C:\Users\Jaime\.cordova\lib\npm_cache\cordova-
android\3.6.4\package\bin\node_modules\q\q.js:827:30)
at Promise.promise.promiseDispatch (C:\Users\Jaime\.cordova\lib\npm_cache\co
rdova-android\3.6.4\package\bin\node_modules\q\q.js:760:13)
at C:\Users\Jaime\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\n
ode_modules\q\q.js:821:14
at flush (C:\Users\Jaime\.cordova\lib\npm_cache\cordova-android\3.6.4\packag
e\bin\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:902:3
Error: C:\Users\Jaime\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\c
reate.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Jaime\AppData\Roaming\npm\node_modules\co
rdova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
Update:
Here's what I have so far:
USER variables:
name: PATH
variable:
C:\Users\Jaime\AppData\Roaming\npm; C:\Program
Files\Java\jdk1.8.0_25\bin;
C:\Development\AndroidSDK\sdk\platform-tools;
C:\Development\AndroidSDK\sdk\tools;
C:\Development\AndroidSDK\sdk\build-tools; C:\Development\ApacheAnt\bin;
C:\Program Files\nodejs;
%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
SYSTEM variables:
name: ANDROID
variable: C:\Development\AndroidSDK\sdk
name: ANT
variable: C:\Development\ApacheAnt
name: JAVA
variable: C:\Program Files\Java\jdk1.8.0_25
Phonegap and cordova installation procedures
what are the need for installiation?
1)node js
download:http://nodejs.org/download/
We have node-v0.10.29-x64.msi (64 bit) installation. After install, open command prompt & type "node -v" , then "npm -v", these 2 commands should work without any error in command prompt.
Open command prompt - (Click windows and R keynd then enter the cmd)
2)phonegap
http://phonegap.com/install/
Install phonegap on cmd: enter npm install -g phonegap on cmd
After installation, files will be placed in C:\Users\Hari\AppData\Roaming\npm folder. You can check the installation by typing the command "phonegap -v" in command prompt.
3)java jdk
http://www.oracle.com/technetwork/java/javase/downloads/index.html?ssSourceSiteId=otnjp
We have jdk-8u5-windows-x64.exe file.
You may need to add path variables in My computer-->Right click-->Properties-->Advanced system settigs-->Environment variables
After install, check "java -version" in command prompt. "where java" will help you to identify the installation path of the java.
4)ant
download:http://ant.apache.org/
We already have apache-ant-1.9.4-bin.zip portable edition of Ant, We need not to install, just need to extract the zip file & place it in some secure place.
You may need to add path variables in My computer-->Right click-->Properties-->Advanced system settigs-->Environment variables
Environment variables name:Ant_Home
Ex: C:\Program Files\apache-ant-1.9.4
5)android sdk
download:http://developer.android.com/sdk/index.html
We have adt-bundle-windows-x86_64-20140624/SDK Manager.exe file.
6)ionic
cmd-->npm install -g ionic
7)cordova
cmd-->npm install -g cordova
PATH SETTING
My computer-->Right click-->Properties-->Advanced system settigs-->Environment variables
Edit the Path and give the like this
C:\Users\prabhu\AppData\Roaming\npm;C:\Program Files\apache-ant-1.9.4\bin;C:\phonegap_project\adt-bundle-windows-x86_64-20131030\sdk\tools;C:\phonegap_project\adt-bundle-windows-x86_64-20131030\sdk\build-tools;C:\Program Files\Java\jdk1.8.0_05\bin;
if Not Run JVM
Set systems variables
Click New
variable Name:_JAVA_OPTIONS
variable value:-Xmx512M
I'm trying to set a phonegap project but I cannot seem to be able to add platforms to it. When I try to add android I get the following error message:
Error: ERROR : executing command 'ant', make sure you have ant installed and add
ed to your path.
at C:\Users\spacitron\.cordova\lib\android\cordova\3.4.0\bin\lib\check_reqs.js:4
7:27
at exithandler (child_process.js:643:7)
at ChildProcess.errorhandler (child_process.js:659:5)
at ChildProcess.EventEmitter.emit (events.js:95:17)
at Process.ChildProcess._handle.onexit (child_process.js:805:12)
Error: C:\Users\spacitron\.cordova\lib\android\cordova\3.4.0\bin\create.bat: Command
failed with exit code 8
at ChildProcess.whenDone (C:\Users\spacitron\AppData\Roaming\npm\node_modules\co
rdova\src\superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
Which doesn't make much sense to me because when I run "and -version" I get the following:
Apache Ant<TM> version 1.9.4 compiled on April 29 2014
So what could I possibly be missing here?
As you error says that it can't find your ant.
You need to add path in your environment variables
PATH
;%JAVA_HOME%\bin;%ANT_HOME%\bin;%ANDROID_SDK%;%ANDROID_ADB%;
(You can also add absolute paths in about command)
ANT_HOME
C:\Program Files\Java\ant\
JAVA_HOME
C:\Program Files\Java\jdk1.7.0_25
ANDROID_SDK
C:\Android\sdk\tools
ANDROID_ADB
C:\Android\sdk\platform-tools
Run these four commands to check every thing is setup properly
adb
android
javac
ant
Creating project command
move to the phonegap android folder.Press Shift+Right Click and select "open Command window here"
create Path_to_Project Package_Name Project_Name
create C:\Users\YourUsername\Desktop com.talha.test HelloWorld
Check these links for more help.1,2.