尽管Dex已启用,但无法找到课程

时间:2017-04-04 15:37:19

标签: eclipse migrate dex android-studio-2.3

我正在尝试将应用程序从Eclipse迁移到android工作室我只有文件,并且在eclipse中编写它的最后一个人并没有导出它用于导入项目。我已经启动了一个新项目并手动导入了文件和lib文件,并试图解决错误,直到程序现在运行而没有Gradle错误。现在我处于这种情况下,Gradle中的dex已启用,但是当我运行该程序时,它很困惑并告诉我它不识别某些类。

这是我的清单文件

<permission
    android:name="com.company.MyProject.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

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

<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.company.MyProject.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<permission
    android:name="com.company.MyProject.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

<uses-permission android:name="com.company.MyProject.permission.C2D_MESSAGE" />

<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<application
    android:name="com.company.MyProject.TruckApplication"
    android:allowBackup="true"
    android:icon="@drawable/MyProject_logo"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:sharedUserId="android.uid.system"
    android:theme="@style/AppTheme" >
    <uses-library android:name="com.google.android.maps" />

    <activity
        android:name="com.company.MyProject.Authenticate_user_Activity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.company.MyProject.Login_Activity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>


    <activity
        android:name="com.company.MyProject.SubmitWaiver_Activity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.company.MyProject.PrepStopChoice"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <!--<activity-->
        <!--android:name="com.company.MyProject.Surveyold_Activity"-->
        <!--android:configChanges="keyboardHidden|orientation|screenSize"-->
        <!--android:screenOrientation="portrait" >-->
    <!--</activity>-->
    <activity
        android:name="com.company.MyProject.GetStops_Activity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.company.MyProject.Load_Activity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.company.MyProject.AddComment_Activity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustResize" >
    </activity>
    <activity
        android:name="com.company.MyProject.StopDetail_Activity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.company.MyProject.CaptureImage_Activity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.company.MyProject.Survey_Activity"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.company.MyProject.GetDirection_Activity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.company.MyProject.Map_FragmentActivity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.company.MyProject.TabBar"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.company.MyProject.ShowStopList_Activity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.company.MyProject.PrepActivity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:screenOrientation="landscape" >
    </activity>
    <activity
        android:name="com.company.MyProject.TransprentActivity"
        android:noHistory="true"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.Translucent.NoTitleBar"
        android:windowSoftInputMode="stateHidden|adjustPan" >
    </activity>

    <receiver
        android:name="com.google.android.gcm.GCMBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

            <category android:name="com.company.MyProject" />
        </intent-filter>
    </receiver>

    <service android:name="com.MyProject.Service.SyncService" >
    </service>

    <receiver android:name="com.MyProject.BrodcastReciver.NetworkStateReceiver" >
        <intent-filter>
            <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
        </intent-filter>
    </receiver>
    <receiver android:name="com.company.MyProject.RepeatingAlarmService" />
    <receiver android:name="com.company.MyProject.RepeatingAlaramCommunication" />
    <receiver android:name="com.company.MyProject.ReaptingAlramNewStops" />

    <service android:name="com.MyProject.Service.LogoutService" >
    </service>
    <service android:name="com.MyProject.Service.CallNewStop_Service" >
    </service>
    <service android:name="com.MyProject.Service.CheckingGooglePlayVersionService" >
    </service>

    <receiver
        android:name="com.MyProject.BrodcastReciver.DateTimeChangeReceiver"
        android:enabled="true"
        android:exported="false" >
        <intent_filter>
            <action android:name="android.intent.action.DATE_CHANGED" />
        </intent_filter>
    </receiver>

    <!-- Start the Service if applicable on boot -->
    <receiver android:name="com.MyProject.BrodcastReciver.PhoneReStartReceiver" >
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>

    <service
        android:name="com.company.MyProject.TruckLocationUpdateService"
        android:enabled="true" />
    <service
        android:name="com.company.MyProject.TruckCommubicationcountService"
        android:enabled="true" />
    <service android:name="com.company.MyProject.GCMIntentService" />
    <service android:name="com.company.MyProject.HandleNotification" />

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyB6Ae82d_eLZ1nMYIW7EaaQ3-2-Xn7duHs" />
    <!-- android:value="AIzaSyAkZzWl6FSP89yWf7VeX6ooYvd6SuRnV4E" /> -->
</application>

<!--<uses-permission-->
    <!--android:name="android.permission.ACCESS_MOCK_LOCATION"-->
    <!--android:required="false" />-->

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

<uses-permission
    android:name="android.permission.FLASHLIGHT"
    android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
    android:protectionLevel="normal"
    android:required="false" />

这是我的gradle文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    useLibrary  'org.apache.http.legacy'
    defaultConfig {
        applicationId "com.company.MyProject"
        minSdkVersion 14
        targetSdkVersion 25
        versionCode 70
        versionName "7.4"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //    compile 'com.android.support:appcompat-v4:25'
    testCompile 'junit:junit:4.12'
    //    compile fileTree(include: '*.jar', dir: 'libs')
    compile 'com.google.android.gms:play-services:10.2.1'
    //    compile "com.google.android.gms:play-services-gcm:10.2.1"
    //    compile 'org.apache.httpcomponents:httpmime:4.5.3'
    //    compile files('libs/gson-2.2.4.jar')
    //    compile files('libs/httpmime-4.2.2.jar')
    //    compile files('libs/joda-time-2.1.jar')
    //    compile files('libs/universal-image-loader-1.9.4.jar')
    compile files('libs/android-support-v4.jar')
}

这是我的错误日志

AndroidRuntime: FATAL EXCEPTION: main
                                                                          Process: com.company.MyProject, PID: 27974
                                                                          java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.company.MyProject/com.company.MyProject.Authenticate_user_Activity}: java.lang.ClassNotFoundException: Didn't find class "com.company.MyProject.Authenticate_user_Activity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
                                                                              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567)
                                                                              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                              at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                                                                              at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                              at android.os.Looper.loop(Looper.java:154)
                                                                              at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
                                                                           Caused by: java.lang.ClassNotFoundException: Didn't find class "com.company.MyProject.Authenticate_user_Activity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
                                                                              at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                              at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
                                                                              at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                                                                              at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
                                                                              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
                                                                              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
                                                                              at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
                                                                              at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                              at android.os.Looper.loop(Looper.java:154) 
                                                                              at android.app.ActivityThread.main(ActivityThread.java:6119) 
                                                                              at java.lang.reflect.Method.invoke(Native Method) 
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
                                                                            Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/MyProject/Interface/Authenticate_Interface;
                                                                              at java.lang.VMClassLoader.findLoadedClass(Native Method)
                                                                              at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
                                                                              at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
                                                                                  ... 12 more
04-04 19:37:17.028 27974-27974/com.company.MyProject E/AndroidRuntime:   Caused by: java.lang.ClassNotFoundException: Didn't find class "com.MyProject.Interface.Authenticate_Interface" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
                                                                              at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                              at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
                                                                              at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                                                                                  ... 15 more
你能帮我解决一下我的问题。

0 个答案:

没有答案