我为周六开始的我所在城市的大型多元文化节构建了一个应用程序。我已经在 iPhone 版本中调整了很多错误,我们正在等待 Apple 批准。我把那个完善的版本作为安卓版本的基础。
Android 版本的外观和效果都很好。我可以在我的三星 Galaxy S II 上运行它,方法是在 Eclipse 中“作为 Android 应用程序运行”,或者将它上传到服务器并下载到手机中。我也可以将应用程序通过电子邮件发送给自己,它也可以使用。我将它提交到 Google 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>