這是我第一次使用Eclipse ADT,並且遇到從其他包啓動新活動時出現問題的情況。我試圖開始com.furgus.cam.CameraActivitycom.furgus.swipe.LobbyActivity但我不斷收到NoClassDefFoundError未能正確鏈接我的CameraActivity。我不完全確定我做錯了什麼,並且非常需要指導。
任何和所有的幫助將不勝感激。謝謝。
NoClassDefException,從另一個包開始活動
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);
}
logcat的
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;
你使用任何外部的jar lib嗎? –