java - Issues creating PhoneGap project in Eclipse with Android SDK -


i'm trying build android app eclipse , phonegap, keep getting error

[2013-05-21 17:47:39 - phonegaptest] project has no target set. edit project properties set one. [2013-05-21 17:47:50 - phonegaptest] parser exception /phonegaptest/androidmanifest.xml: premature end of file. 

...on opening project. open project properties , set target, xml exception persists. i've cleaned , built project, uninstalled , redownloaded android sdk , updated adt, no avail. androidmanifest.xml empty. in errors console have this...

archive required library: 'e:/androidprojects/workspace/phonegaptest/libs/cordova-2.7.0.jar' in project 'phonegaptest' cannot read or not valid zip file    build path problem 

ah, i'm seeing cordova jar in project empty. must happening every time, since i've tried rebuilding project phonegap create command on terminal 100 times. why happening?

edit - ok, i'm adding cordova jar directly copy , paste download, when try create android project existing source nothing happens. folder doesn't show in package explorer. why phonegap command line create tool creating project empty androidmanifest.xml , empty cordova jar can't open?

edit - ok, think @ least part of problem was using spaces in of environment variables, program files. i've taken care of %programfiles% variable, , directory phonegap produces has valid cordova jar , androidmanifest.xml file @ 4kb. here's content of androidmanifest.xml after using phonegap create command line tool...

<?xml version="1.0" encoding="utf-8"?> <!--        licensed apache software foundation (asf) under 1        or more contributor license agreements.  see notice file        distributed work additional information        regarding copyright ownership.  asf licenses file        under apache license, version 2.0 (the        "license"); may not use file except in compliance        license.  may obtain copy of license @           http://www.apache.org/licenses/license-2.0         unless required applicable law or agreed in writing,        software distributed under license distributed on        "as is" basis, without warranties or conditions of        kind, either express or implied.  see license        specific language governing permissions , limitations        under license. --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:windowsoftinputmode="adjustpan"       package="com.gsu.phonegaptest" android:versionname="1.0" android:versioncode="1" android:hardwareaccelerated="true">     <supports-screens         android:largescreens="true"         android:normalscreens="true"         android:smallscreens="true"         android:xlargescreens="true"         android:resizeable="true"         android:anydensity="true"         />      <uses-permission android:name="android.permission.camera" />     <uses-permission android:name="android.permission.vibrate" />     <uses-permission android:name="android.permission.access_coarse_location" />     <uses-permission android:name="android.permission.access_fine_location" />     <uses-permission android:name="android.permission.access_location_extra_commands" />     <uses-permission android:name="android.permission.internet" />     <uses-permission android:name="android.permission.receive_sms" />     <uses-permission android:name="android.permission.record_audio" />     <uses-permission android:name="android.permission.record_video"/>     <uses-permission android:name="android.permission.modify_audio_settings" />     <uses-permission android:name="android.permission.read_contacts" />     <uses-permission android:name="android.permission.write_contacts" />        <uses-permission android:name="android.permission.write_external_storage" />        <uses-permission android:name="android.permission.access_network_state" />     <uses-permission android:name="android.permission.get_accounts" />     <uses-permission android:name="android.permission.broadcast_sticky" />       <application android:icon="@drawable/icon" android:label="@string/app_name"         android:hardwareaccelerated="true"         android:debuggable="true">         <activity android:name="phonegaptest" android:label="@string/app_name"                 android:theme="@android:style/theme.black.notitlebar"                 android:configchanges="orientation|keyboardhidden|keyboard|screensize|locale">             <intent-filter>                 <action android:name="android.intent.action.main" />                 <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>     </application>      <uses-sdk android:minsdkversion="7" android:targetsdkversion="17"/> </manifest>  

...and cordova jar 251 kb, should be. here's strange part. after create android project eclipse using existing code phonegap documentation specifies, contents of androidmanifest.xml deleted, down 0 kb, , .project file produced empty well. not that, i'm still getting same errors. these on console...

[2013-05-21 18:27:13 - phonegaptest] project has no target set. edit project properties set one. [2013-05-21 18:27:14 - phonegaptest] parser exception /phonegaptest/androidmanifest.xml: premature end of file. 

..(makes sense because androidmanifest emtpy), , these on errors dialog...

description resource    path    location    type archive required library: 'e:/androidprojects/workspace/phonegaptest/libs/cordova-2.7.0.jar' in project 'phonegaptest' cannot read or not valid zip file    phonegaptest        build path  build path problem  parser exception /phonegaptest/androidmanifest.xml: premature end of file.  phonegaptest        line 1  android adt problem  project cannot built until build path errors resolved    phonegaptest        unknown java problem  premature end of file.  androidmanifest.xml /phonegaptest   line 1  android xml format problem 

edit - ok, exact sequence creating project, if helps, following...

  1. navigate phonegap*/lib/android/bin , run command ./create phonegaptest com.gsu.phonegaptest phonegaptest. output step following...

    creating new android project... copying template jars... copying js, jar, , config.xml files... copying cordova command tools... updating androidmanifest.xml , mainactivity...

  2. fire eclipse android adt , navigate new > project > android > android project existing code

  3. browse workspace created phonegaptest project in step 1., select copy project workspace checkbox (if don't message box reading invalid project description), click finish.

  4. now phonegaptest shows in project explorer, along these errors...

    [2013-05-22 15:36:10 - phonegaptest] project has no target set. edit project properties set one. [2013-05-22 15:36:31 - phonegaptest] parser exception /phonegaptest/androidmanifest.xml: premature end of file.

...so click on project properties > android > project build target , select android 4.2.2 (this other option google apis)

here have no idea androidmanifest, emtpy. seems root of problem me. when build android project existing source, androidmanifest.xml somehow becomes empty.

ok got it. creating project phonegap create utility inside eclipse workspace. apparently when , create project existing source eclipse copies , new empty androidmanifest.xml file, problem. created project create utility elsewhere in file system, created project existing source within eclipse , did not select copy project workspace checkbox, , seems fine now, original androidmanifest.xml preserved.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -