NoClassDefException, starting activity from another package

This is my first time using Eclipse ADT, and I'm having trouble starting a new action from another package. I try to run com.furgus.cam.CameraActivity from com.furgus.swipe.LobbyActivity , but I keep getting NoClassDefFoundError from the crash for the correct CameraActivity binding. I'm not quite sure what I'm doing wrong, and I really need guidance.

We will be very grateful for any help. Thank you


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;
+2
source share
2 answers

Try the following:

Project/Properties/Java Build Path/Order and Export. , Android- , . " ".

, .

+7

:

jar

project- > config build path- > order and export- >

, , Google API (, ), , Android API.

+1

Source: https://habr.com/ru/post/1532648/


All Articles