我正在尝试在 eclipse juno 上运行一个 android 项目并在 samsung tab 10.1 上对其进行测试。项目的 .apk 文件正在我的 comp 上创建,但未在选项卡上正确加载。有人可以帮我解决这个问题吗?
编辑:Android 版本是 4.1.2,这与选项卡相同。从选项卡得到的错误是“不幸的是 AppName 已停止。”。同样的项目在另一台机器上运行良好。我刚刚在我的 Eclipse 中导入了代码库。
日志如下。
06-22 12:46:44.260: E/AndroidRuntime(25528): FATAL EXCEPTION: main
06-22 12:46:44.260: E/AndroidRuntime(25528): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.belgium.initial/com.belgium.initial.initial}: java.lang.ClassNotFoundException: com.belgium.initial.initial
06-22 12:46:44.260: E/AndroidRuntime(25528): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2021)
06-22 12:46:44.260: E/AndroidRuntime(25528): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
06-22 12:46:44.260: E/AndroidRuntime(25528): at android.app.ActivityThread.access$600(ActivityThread.java:140)
06-22 12:46:44.260: E/AndroidRuntime(25528): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
06-22 12:46:44.260: E/AndroidRuntime(25528): at android.os.Handler.dispatchMessage(Handler.java:99)
06-22 12:46:44.260: E/AndroidRuntime(25528): at android.os.Looper.loop(Looper.java:137)
06-22 12:46:44.260: E/AndroidRuntime(25528): at android.app.ActivityThread.main(ActivityThread.java:4895)
06-22 12:46:44.260: E/AndroidRuntime(25528): at java.lang.reflect.Method.invokeNative(Native Method)
06-22 12:46:44.260: E/AndroidRuntime(25528): at java.lang.reflect.Method.invoke(Method.java:511)
06-22 12:46:44.260: E/AndroidRuntime(25528): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
06-22 12:46:44.260: E/AndroidRuntime(25528): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
06-22 12:46:44.260: E/AndroidRuntime(25528): at dalvik.system.NativeStart.main(Native Method)
06-22 12:46:44.260: E/AndroidRuntime(25528): Caused by: java.lang.ClassNotFoundException: com.belgium.initial.initial
06-22 12:46:44.260: E/AndroidRuntime(25528): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
06-22 12:46:44.260: E/AndroidRuntime(25528): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-22 12:46:44.260: E/AndroidRuntime(25528): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-22 12:46:44.260: E/AndroidRuntime(25528): at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
06-22 12:46:44.260: E/AndroidRuntime(25528): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2012)
06-22 12:46:44.260: E/AndroidRuntime(25528): ... 11 more
Android 清单如下:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:windowSoftInputMode="adjustPan"
package="com.belgium.initial" android:versionName="1.1" android:versionCode="5" android:hardwareAccelerated="true">
<supports-screens
android:xlargeScreens="true"
/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:icon="@drawable/icon" android:label="Presbelg"
android:hardwareAccelerated="true"
android:debuggable="true"
>
<activity android:name=".initial" android:label="Presbelg"
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="16"/>
</manifest>