在Android Studio依赖项中添加Evernote库会产生我的类的java.lang.NoClassDefFoundError

时间:2017-08-18 08:25:01

标签: android sdk evernote

刚开始整合Evernote SDK for Android。当我添加evernote依赖

compile 'com.evernote:android-sdk:2.0.0-RC4'

项目仍然是可编译的,但它会破坏wjava.lang.NoClassDefFoundError首次尝试使用Sqlite时出现:

FATAL EXCEPTION: Process: com.myProject, PID: 14317
    java.lang.NoClassDefFoundError: com.myProject.SettingsDA$$Lambda$2
    at com.myProject.SettingsDA.getSettingValue(SettingsDA.java:94)
    at com.myProject.MyApplication.onCreate(MyApplication.java:67)


public String getSettingValue(String key, String defaultValue) {
        String query = "Select value from settings_table where id = ? ";
        String result = runSingleQuery(query, new String[]{key}, null, cursor -> cursor.getString(0));
        return result;
    }


public <T> T runSingleQuery(final String query, final String[] params, final T value, final Func1<Cursor, T> factory) {
        final SQLiteDatabase database = getWritableDatabase();
        final Cursor cursor = database.rawQuery(query, params);

        try {
            if (cursor != null && cursor.moveToFirst()) {
                return factory.call(cursor);
            }
            return value;
        } finally {
            close(cursor);
        }
    }

目前的依赖关系是:

compile 'com.evernote:android-sdk:2.0.0-RC4'
compile 'com.jakewharton:butterknife:5.1.2'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'org.apache.commons:commons-lang3:3.1'
compile 'com.squareup:otto:1.3.5'
compile 'io.reactivex:rxjava:1.0.0-rc.6'
compile 'io.reactivex:rxandroid:0.21.0'
compile 'com.google.android.gms:play-services-plus:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-invites:11.0.4'
compile 'com.google.android.gms:play-services-drive:11.0.4'
compile 'com.google.android.gms:play-services-identity:11.0.4'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.google.android.gms:play-services-places:11.0.4'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'

我想错过要添加到项目中的内容吗?

0 个答案:

没有答案