我使用早期版本的Realm创建了Realm Database文件。由于先前生产版本中的错误,我正在尝试将其更新为新版本,但它失败了
Error:Execution failed for task ':app:transformClassesWithRealmTransformerForDebug'.
> javassist.NotFoundException: io.realm.MyModelRealmProxyInterface
更新
运行./gradlew clean assemble
-
:app:compileRetrolambdaDebug
:app:prePackageMarkerForDebug
:app:transformClassesWithRealmTransformerForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithRealmTransformerForDebug'.
> javassist.NotFoundException: io.realm.MyModelRealmProxyInterface
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 1 mins 9.423 secs
更新2
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'me.tatarka.retrolambda'
android {
compileSdkVersion 23
buildToolsVersion '24 rc1'
dexOptions {
incremental true
javaMaxHeapSize "2048M"
}
splits {
abi {
enable true
reset()
include 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips'
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
defaultConfig {
applicationId "com.conem.app"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.3.4"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled true
shrinkResources
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
/*debug {
applicationIdSuffix ".debug"
}*/
}
}
ext.versionCodes = ['armeabi': 55, 'armeabi-v7a': 56, 'arm64-v8a': 57, 'mips': 58, 'x86': 59, 'x86_64': 60]
import com.android.build.OutputFile
android.applicationVariants.all { variant ->
// assign different version code for each output
variant.outputs.each { output ->
output.versionCodeOverride =
project.ext.versionCodes.get(output.getFilter(OutputFile.ABI)) * 1000000 + android.defaultConfig.versionCode
/*output.versionNameOverride =
String.valueOf(project.ext.versionCodes.get(output.getFilter(OutputFile.ABI)) * 1000000 + android.defaultConfig.versionCode)
*/ }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//compile files('libs/InMobi-5.2.3.jar')
compile files('libs/libadapterinmobi.jar')
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
//compile files('libs/realm-android-0.87.4.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.squareup:otto:1.3.8'
compile 'com.android.support:design:23.1.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.google.code.gson:gson:2.3'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
}