活动的android - 应用程序崩溃

时间:2016-03-15 08:13:49

标签: android android-studio noclassdeffounderror activeandroid

我重新安装了android studio,从那以后我在logcat中遇到了问题:

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:2.5.5@aar') {
    transitive = true;
}

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

我也尝试过活动的android 3.1 beta gradle链接,但这也无效。 我做错了什么?

3 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

尝试将 libs / activeandroid-3.0.jar 更改为

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

答案 2 :(得分:0)

  

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

如果Java虚拟机或ClassLoader实例尝试加载类的定义(作为普通方法调用的一部分或作为使用新表达式创建新实例的一部分),则抛出该类,并且没有类的定义可以被发现。

您必须在 Build.gradle(app)

中的依赖项之上添加存储库代码
LopNr   SJUKHUS MVO INDATUMA    UTDATUMA    HDIA    DIAGNOS OP  PVARD   EKOD1   EKOD2   EKOD3   EKOD4   EKOD5   ICD
1562    21001   046 20030707    20030711    I489A   I489A I509      2                       10
1562    21001   046 2003o730    20030801    I501    I501 I489A  DG001   2                       10

然后致电

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