PhoneGap APK运行良好,但在Google Play部署后每次运行都会崩溃

时间:2012-08-02 19:09:24

标签: android eclipse cordova

我已经在我的城市建立了一个大型多元文化节日的应用程序,该节目将于周六开始。我已经在iPhone版本中调整了很多错误,我们正在等待Apple批准它。我已经将完善版本作为Android版本的基础。

Android版看起来很棒。我可以在我的三星Galaxy S II上通过Eclipse中的“Run as Android Application”运行它,或者将其上传到服务器并将其下载到手机中。我也可以通过电子邮件将应用程序发送给自己,它也有效。我将它提交到谷歌Play商店,一旦它进入野外(这是广告牌,公共汽车,无处不在),它会在它打开的那一刻崩溃。

我不确定如何在发布之前在设备上正常工作时对此进行故障排除。我读到了它与MainActivity活动名称的关系,但所有内容看起来都排成一行。

错误1 [PathClassLoader.findClass()中的ClassNotFoundException]:

java.lang.RuntimeException: Unable to instantiate activity 
ComponentInfo{com.honestapi.folk2011/com.honestapi.folk2011.Folklorama}: 
java.lang.ClassNotFoundException: com.honestapi.folk2011.Folklorama in loader 
dalvik.system.PathClassLoader[/data/app/com.honestapi.folk2011-1.apk]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1660)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
at android.app.ActivityThread.access$1500(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:126)
at android.app.ActivityThread.main(ActivityThread.java:3997)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.honestapi.folk2011.Folklorama in loader dalvik.system.PathClassLoader[/data/app/com.honestapi.folk2011-1.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)
at java.lang.ClassLoader.loadClass(ClassLoader.java:548)
at java.lang.ClassLoader.loadClass(ClassLoader.java:508)
at android.app.Instrumentation.newActivity(Instrumentation.java:1022)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)

错误2 [BaseDexClassLoader.findClass()中的ClassNotFoundException]:

java.lang.RuntimeException: Unable to instantiate activity    
ComponentInfo{com.honestapi.folk2011/com.honestapi.folk2011.Folklorama}:        
java.lang.ClassNotFoundException: com.honestapi.folk2011.Folklorama
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1894)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
at android.app.ActivityThread.access$600(ActivityThread.java:128)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4514)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.honestapi.folk2011.Folklorama
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1027)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1885)

任何帮助将不胜感激!我非常喜欢。

编辑 - 这是bin文件夹中的AndroidManifest.xml     

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />

<supports-screens android:largeScreens="true" android:normalScreens="true"   android:smallScreens="true" android:resizeable="false" 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.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" />
<uses-permission android:name="android.permission.CAMERA" />

<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">

<intent-filter>
    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="com.google.zxing.client.android.CaptureActivity"              android:screenOrientation="landscape"               android:configChanges="orientation|keyboardHidden"              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"               android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
    <action android:name="com.phonegap.plugins.barcodescanner.SCAN"/>
    <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name="com.google.zxing.client.android.encode.EncodeActivity" android:label="@string/share_name">
  <intent-filter>
    <action android:name="com.phonegap.plugins.barcodescanner.ENCODE"/>
    <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>
</activity>
</application>

</manifest>

1 个答案:

答案 0 :(得分:0)

事实证明我的主要Java文件名为“MainActivity.java”,但在整个项目文件中它被称为“Folklorama.java”。我将文件重命名为Folklorama.java。