2016-03-15 125 views
0

我重新安裝了Android的工作室,從那時起,我在我的logcat中面臨的問題:Android活躍 - 應用程序崩潰

FATAL EXCEPTION: main 
Process: loop.org.digitalgreen.loop, PID: 21167 
java.lang.NoClassDefFoundError: android.support.v4.hardware.fingerprint.FingerprintManagerCompatApi23$1 
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:309) 
at com.activeandroid.ReflectionUtils.getModelClasses(ReflectionUtils.java:83) 
at com.activeandroid.DatabaseHelper.onCreate(DatabaseHelper.java:46) 
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:251) 
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163) 
at com.activeandroid.Registry.openDatabase(Registry.java:149) 
at com.activeandroid.Registry.initialize(Registry.java:107) 
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:8) 
at loop.org.digitalgreen.loop.utils.MyApplication.onCreate(MyApplication.java:41) 
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1035) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4638) 
at android.app.ActivityThread.access$1500(ActivityThread.java:155) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1378) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5343) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) 

這是以前工作的罰款。

我gradle這個文件看起來像:

buildscript { 
repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 

dependencies { 
    classpath 'io.fabric.tools:gradle:1.+' 
}}apply plugin: 'com.android.application' apply plugin: 'io.fabric'        android { 
compileSdkVersion 23 
buildToolsVersion "23.0.2" 

defaultConfig { 
    applicationId "A.b.c" 
    minSdkVersion 14 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 
} } dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
compile files('libs/activeandroid-3.0.jar') 
compile 'com.android.support:appcompat-v7:23.1.1' 
compile 'com.android.support:design:23.1.1' 
compile 'com.google.code.gson:gson:2.2.4' 
compile 'com.mcxiaoke.volley:library:1.0.17' 
compile 'com.github.bumptech.glide:glide:3.6.1' 
compile 'de.hdodenhof:circleimageview:2.0.0' 
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
    transitive = true; 
} 

compile 'com.android.support:cardview-v7:23.2.0'} 

我也嘗試過Android活躍測試3.1的gradle鏈接但也不能正常工作。 我在做什麼錯?

+0

調用'編譯「com.android.support:cardview-v7 :23.1.0'' –

+0

那也行不通 –

回答

0

試圖改變庫/ activeandroid-3.0.jar

compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'

+0

多數民衆贊成不工作 –

+0

也許com.android.support:support-v4:23.0.0? – grebulon

0

java.lang.NoClassDefFoundError: android.support.v4.hardware.fingerprint.FingerprintManagerCompatApi23$1

時拋出的Java虛擬機或ClassLoader實例會嘗試加載類的定義(作爲常規方法調用的一部分,或者作爲使用新表達式創建新實例的一部分)並且不定義的類可以找到。

您必須添加在的build.gradle(APP)的依賴

repositories { 
    mavenCentral() 
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 
} 

上述庫代碼然後調用

compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT' 
+0

請檢查這個http://stackoverflow.com/questions/32484185/getting-java-lang-noclassdeffounderror-after-updating-to-api-23 –

+0

現在的問題是查詢數據庫。當我試圖查詢我的數據庫時發生錯誤 –

+0

@AbhishekLodha卸載應用程序並再次運行。然後檢查Sqlite數據庫問題 –