tot*_*ire 9 android ormlite android-studio
您好我在运行时使用Android Studio时遇到此错误,但仅在SDK版本<= 19的设备上出现此错误.一切正常编译但我在我的databaseHelper类上出现此错误.
java.lang.NoClassDefFoundError:
Run Code Online (Sandbox Code Playgroud)
这是我的app build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.github.johnpersano:supertoasts:1.3.4@aar'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile 'com.navercorp.pulltorefresh:library:3.2.0@aar'
compile 'com.parse.bolts:bolts-android:1.2.1'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.j256.ormlite:ormlite-core:4.48'
}
Run Code Online (Sandbox Code Playgroud)
我的databaseHelper类扩展OrmLiteSqliteOpenHelper
Everything工作正常,而我的compileSdkVersion是19岁.这是我更新的内容:
classpath 'com.android.tools.build:gradle:1.1.0'> 1.3.0compileSdkVersion 19> 23com.android.support:appcompat-v7:19.0.1> 23我的databaseHelper类与其他类完全相同的包在同一个包中!
谢谢您的帮助
Amy*_*yth 11
就像你multiDexEnabled true在build.gradle中一样.确保您的应用程序类是扩展MultiDexApplication而不是Application类.
或者,如文档中所建议,您可以将以下方法添加到应用程序类中.
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4781 次 |
| 最近记录: |