vendredi 27 février 2015

Netbeans cordova generates index.html file incorrectly?

This is the code pre-generated by netbeans when a new cordova application is run. Line number 5 throws an error in netbeans, saying that the keyword msapplication-tap-highlight is not registered. Also, in line 19, the file cordova.js does not exist in the cordova project. When i try run the application through an android emulator, it gives me a build failed message. Build failed message written below html file. I tried launching the html file in android emulator through the command line, but



/Users/Programming/Desktop/Coding/GenericApp/www/index.html: Permission denied


Also, the command "android" suggested at the bottom of the Build Failed message does nothing in my Terminal. Any suggestions on how to solve any of the above problems would be appreciated.



<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See http://ift.tt/1hFCJLr -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
</head>
<body>
<div class="app">
<h1>Apache Cordova</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
</html>

ant -f /Users/Programming/Desktop/Coding/GenericApp/nbproject "-Dupdate.task.jar=/Applications/NetBeans/NetBeans http://ift.tt/1wn4YVo" -Dandroid.project.activity=GenericApp -Dsite.root=www -Dstart.file=index.html -Dandroid.sdk.home=/Users/Programming/Library/Android/sdk -Dandroid.target.device.arg=emulate -Dcordova.version=4.2.0-0.0.0 -Denv.DISPLAY=:0.0 "-Dios.certificate.name=iPhone Developer" -Dandroid.build.target=android-21 -Dconfig=android sim-android
check-android-template:
check-cordova-version:
check-cordova-project:
upgrade-to-cordova-project:
create-android:
cordova -d platform add android
Creating android project...
Running command: /Users/Programming/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create --cli /Users/Programming/Desktop/Coding/GenericApp/platforms/android com.coolappz.GenericApp GenericApp
Command finished with error code 1: /Users/Programming/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create --cli,/Users/Programming/Desktop/Coding/GenericApp/platforms/android,com.coolappz.GenericApp,GenericApp
/Users/Programming/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:126
throw e;
^
Error: Please install Android target "android-19".
Hint: Run "android" from your command-line to open the SDK manager.
at /Users/Programming/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:174:19
at _fulfilled (/Users/Programming/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/Users/Programming/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/Users/Programming/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:760:13)
at /Users/Programming/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:574:44
at flush (/Users/Programming/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:355:11)
Error: /Users/Programming/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
/Users/Programming/Desktop/Coding/GenericApp/nbproject/build.xml:150: exec returned: 1
BUILD FAILED (total time: 10 seconds)

Aucun commentaire:

Enregistrer un commentaire