gpt4 book ai didi

java - NoClassDefException,从另一个包开始 Activity

转载 作者:太空狗 更新时间:2023-10-29 15:53:28 25 4
gpt4 key购买 nike

这是我第一次使用 Eclipse ADT,我在从不同的包开始新 Activity 时遇到了问题。我正在尝试从 com.furgus.swipe.LobbyActivity 启动 com.furgus.cam.CameraActivity 但我一直收到 NoClassDefFoundError 失败正确链接我的 CameraActivity。我不确定自己做错了什么,非常需要指导。

如有任何帮助,我们将不胜感激。谢谢。


AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.furgus"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />

<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/>

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<service
android:name=".swipe.SocketService"
android:icon="@drawable/ic_launcher"
android:label="socket_service" >
</service>
<activity
android:name=".swipe.LobbyActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" />
<activity
android:name=".cam.CameraActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />

</application>

LobbyActivity.java

if (str.equalsIgnoreCase(KEY_START_GAME)) {
Intent newIntent = new Intent(CONTEXT, CameraActivity.class);
Bundle extras = new Bundle();
extras.putString(KEY_USERNAME, username);
extras.putString(KEY_MATCH, match);
extras.putString(KEY_TEAM, team);
newIntent.putExtras(extras);
startActivity(newIntent);
}

日志猫

02-18 13:51:00.909: I/dalvikvm(12358): Failed resolving Lcom/furgus/cam/CameraActivity; interface 695 'Lorg/opencv/android/CameraBridgeViewBase$CvCameraViewListener2;'
02-18 13:51:00.909: W/dalvikvm(12358): Link of class 'Lcom/furgus/cam/CameraActivity;' failed
02-18 13:51:00.909: E/dalvikvm(12358): Could not find class 'com.furgus.cam.CameraActivity', referenced from method com.furgus.swipe.LobbyActivity.updateUI
02-18 13:51:00.909: W/dalvikvm(12358): VFY: unable to resolve const-class 565 (Lcom/furgus/cam/CameraActivity;) in Lcom/furgus/swipe/LobbyActivity;

最佳答案

试试这个:

转到 Project/Properties/Java Build Path/Order and Export——确保在 Android Dependencies 和支持库前面有一个检查,如果你使用它。标记所有复选框并单击 Apply 并清理项目。

希望这对您有所帮助。

关于java - NoClassDefException,从另一个包开始 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21845778/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com