我遵循PhoneGap Android入門指示。唯一不完全如步驟中所述的是我有Cordova 2.1.0版。應用程序在我的手機上構建並安裝,但在啓動後會出現ClassNotFoundException。PhoneGap上的ClassNotFoundException Android上的入門
java.lang.RuntimeException:無法在loader dalvik.system中實例化活動ComponentInfo {com.example.phonegaptest/com.example.phonegaptest.MainActivity}:java.lang.ClassNotFoundException:com.example.phonegaptest.MainActivity。 PathClassLoader [/data/app/com.example.phonegaptest-2.apk]
MainActivity是應用程序中唯一的類。爲什麼找不到它?
更新: 這裏是我的清單:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true" />
<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.READ_PHONE_STATE" />
<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.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/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main"
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>
貴AndroidManifest.xml中是什麼樣子?這可能是問題所在。 –