找不到SQLiteAssetHelper utils

时间:2016-11-18 15:56:22

标签: java android

我之前有另一篇文章说我的项目class not found exceptionIOUtils。我解决了这个问题,现在我的项目又崩溃了。

上一篇文章:Android class not found when running on some devices but not on others

现在给我这个堆栈跟踪:

java.lang.NoClassDefFoundError: com.readystatesoftware.sqliteasset.Utils
    at com.readystatesoftware.sqliteasset.SQLiteAssetHelper.copyDatabaseFromAssets(SQLiteAssetHelper.java:455)
    at com.readystatesoftware.sqliteasset.SQLiteAssetHelper.createOrOpenDatabase(SQLiteAssetHelper.java:400)
    at com.readystatesoftware.sqliteasset.SQLiteAssetHelper.getWritableDatabase(SQLiteAssetHelper.java:176)
    at com.testing.data.AppDatabase.<init>(AppDatabase.java:87)
    at com.testing.data.AppDatabase.getInstance(AppDatabase.java:70)

当我尝试在平板电脑上运行它时它会起作用,当我尝试在手机上运行它时会崩溃:

以下是设置:

Android versions:
`Phone: 4.4.2`
`Tablet: 5.1.1`

SDK Setup:
`compileSdkVersion: 25`
`minSdkVersion: 15`
`targetSdkVersion: 24`

可能存在冲突吗?似乎不太可能,但它们都是未找到的Util类。

按要求评分:

apply plugin: 'com.android.application'

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':volley')
    compile group: 'commons-io', name: 'commons-io', version: '2.5'
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:design:25.0.0'
    compile 'com.android.support:support-v4:25.0.0'
    compile 'com.android.support:recyclerview-v7:25.0.0'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.google.android.gms:play-services-maps:8.3.0'
    compile 'com.google.maps.android:android-maps-utils:0.3.+'
    compile 'com.qozix:tileview:2.2.3'
    compile 'com.facebook.android:facebook-android-sdk:4.7.0'
    compile 'org.twitter4j:twitter4j-core:4.0.4'
    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
    compile 'info.hoang8f:android-segmented:1.0.5'
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.testing.base"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }
}

repositories {
    mavenCentral()
}

0 个答案:

没有答案