由于将现有项目从 phonegap 3.0 升级到 3.1,当我在设备上构建/运行它时,会在手机上创建应用程序的两个图标。它们彼此相邻并且相同。有趣的是,手机的“下载”中只列出了一个,卸载它会导致这两个图标从手机的应用程序列表中消失。
但是,当点击其中一个图标按预期运行应用程序时,点击另一个图标会给出“不幸的是,[应用程序名称] 已停止”,并在 Logcat 中抛出以下内容:
11-13 18:50:18.011: E/AndroidRuntime(24632): FATAL EXCEPTION: main
11-13 18:50:18.011: E/AndroidRuntime(24632): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.fernando/com.fernando.ActivityGoogleMap}: java.lang.ClassNotFoundException: com.fernando.ActivityGoogleMap
11-13 18:50:18.011: E/AndroidRuntime(24632): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2038)
11-13 18:50:18.011: E/AndroidRuntime(24632): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2139)
11-13 18:50:18.011: E/AndroidRuntime(24632): at android.app.ActivityThread.access$700(ActivityThread.java:143)
11-13 18:50:18.011: E/AndroidRuntime(24632): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1241)
11-13 18:50:18.011: E/AndroidRuntime(24632): at android.os.Handler.dispatchMessage(Handler.java:99)
11-13 18:50:18.011: E/AndroidRuntime(24632): at android.os.Looper.loop(Looper.java:137)
11-13 18:50:18.011: E/AndroidRuntime(24632): at android.app.ActivityThread.main(ActivityThread.java:4960)
11-13 18:50:18.011: E/AndroidRuntime(24632): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 18:50:18.011: E/AndroidRuntime(24632): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 18:50:18.011: E/AndroidRuntime(24632): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
11-13 18:50:18.011: E/AndroidRuntime(24632): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
11-13 18:50:18.011: E/AndroidRuntime(24632): at dalvik.system.NativeStart.main(Native Method)
11-13 18:50:18.011: E/AndroidRuntime(24632): Caused by: java.lang.ClassNotFoundException: com.fernando.ActivityGoogleMap
11-13 18:50:18.011: E/AndroidRuntime(24632): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
11-13 18:50:18.011: E/AndroidRuntime(24632): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
11-13 18:50:18.011: E/AndroidRuntime(24632): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
11-13 18:50:18.011: E/AndroidRuntime(24632): at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
11-13 18:50:18.011: E/AndroidRuntime(24632): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2029)
有没有其他人遇到过这个?
安卓清单:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="1.0.0" android:windowSoftInputMode="adjustPan" package="com.fernando" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="18" />
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<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.ACCESS_COMPASS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:debuggable="true" android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="FAlbayzin" android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps" />
<activity android:label="@string/app_name" android:name=".ActivityGoogleMap" android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>