ghost
ghost

Reputation: 45

phonegap create new project error

I have some problem when I try to create new phonegap project via command prompt.

I followed the steps provided here

But when I try to create my new project the result is this enter image description here

JDK 1.7, apache ant and android SDK are installed in the environment.

Can anyone help me?

i've fix the problem with the cmd, now the problem is that in the res folder,there are some errors(god bless the import process via shell), some one can help?

enter image description here

i replace the files with the cordoba source file(main.xml and strings.xml). But the big exclamation mark remain on the project folder

the android manifest is this:

<?xml version="1.0" encoding="utf-8"?>

<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/MercatApp" android:allowBackup="true"
    android:hardwareAccelerated="true">
    <activity android:name="example" android:label="@string/MercatApp"
            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"/>

Eclipse say for this line:

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="17"/>

uses-sdk tag appear after application tag

need help please.

enter image description here

Upvotes: 1

Views: 761

Answers (2)

anomepani
anomepani

Reputation: 1846

I think You use Phonegap plugin for eclipse that is available at Phonegap tool directory and you can also download and install from this link [AppLaud] (http://www.mobiledevelopersolutions.com/home/start)

using this tool there is no such error what u have face while creating project. @ghost I think u have to try new Phonegap Sdk 3.0 Which is also support Command line project creation and also compile project using command line on locally or you can build project remotely.

Upvotes: 1

Amol Chakane
Amol Chakane

Reputation: 1511

Follow following steps to create project

     1. Download cordova from phonegap site, extract it.
     2. Create Android project using File > New Project menu in eclipse.
     3. Add cordova.jar from downloaded phonegap folder in libs folder.
     4. Add build path for cordova.jar (Right click libs folder Build Path > Configure build path).
     5. Add xml folder from downloaded phonegap folder to project's res folder.
     6. Add reference of cordova.js in all your html files.
     7. Add necessary permissions in AndroidManifest.xml file.
     8. Add following code to your Activity.java file(src > com.yourpackage.com > Activity.java)
     import org.apache.cordova.DroidGap;
     public class YourActivity extends DroidGap {

          @Override
          public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
          }

     }

Upvotes: 1

Related Questions