Gradle和Realm库的编译问题

时间:2016-09-03 01:52:10

标签: java android android-studio gradle realm

将Realm添加到项目后,我遇到了编译问题。我目前在Android Studio 2.1.3中使用Kotlin。这是终端的输出:

C:\Users\carre\Desktop\MBTA_99\MyApplication>gradlew build
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html.
Incremental java compilation is an incubating feature.                                    
:app:preBuild UP-TO-DATE                                        
:app:preInstantrunconfigDebugBuild UP-TO-DATE
:app:checkInstantrunconfigDebugManifest
:app:preInstantrunconfigReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE     
:app:prepareComAndroidSupportCardviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV132301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComGetkeepsafeRelinkerRelinker121Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase940Library UP-TO-DATE      
:app:prepareComGoogleAndroidGmsPlayServicesBasement940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesClearcut940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesContextmanager940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGass940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlaces940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthCommon940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon940Library UP-TO-DATE      
:app:prepareComGoogleFirebaseFirebaseConfig940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCrash940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabase940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorageCommon940Library UP-TO-DATE
:app:prepareComGoogleMapsAndroidAndroidMapsUtils044Library UP-TO-DATE
:app:prepareIoRealmRealmAndroidLibrary120Library UP-TO-DATE
:app:prepareInstantrunconfigDebugDependencies
:app:compileInstantrunconfigDebugAidl UP-TO-DATE
:app:compileInstantrunconfigDebugRenderscript UP-TO-DATE
:app:generateInstantrunconfigDebugBuildConfig UP-TO-DATE
:app:mergeInstantrunconfigDebugShaders UP-TO-DATE      
:app:compileInstantrunconfigDebugShaders UP-TO-DATE
:app:generateInstantrunconfigDebugAssets UP-TO-DATE
:app:mergeInstantrunconfigDebugAssets UP-TO-DATE
:app:generateInstantrunconfigDebugResValues UP-TO-DATE
:app:generateInstantrunconfigDebugResources UP-TO-DATE
:app:mergeInstantrunconfigDebugResources UP-TO-DATE      
:app:processInstantrunconfigDebugManifest UP-TO-DATE      
:app:processInstantrunconfigDebugResources UP-TO-DATE
:app:generateInstantrunconfigDebugSources UP-TO-DATE
:app:incrementalInstantrunconfigDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileInstantrunconfigDebugKotlin                 
e: C:\Users\carre\Desktop\MBTA_99\MyApplication\app\src\main\java\ninja\carre\mbta\activities\trainstation_list\TrainListAct.kt: (21, 12): Unresolved reference: squareup
:app:compileInstantrunconfigDebugKotlin FAILED          

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileInstantrunconfigDebugKotlin'.
> Compilation error. See log for more details

* 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: 17.161 secs

这是我的gradle文件的样子:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.0.3'
    ext.build_tools_version = '23.2.1'
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'com.github.jacobono:gradle-jaxb-plugin:1.3.6'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}


allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

subprojects { project ->
    if(project.name.endsWith("-schema")) {
        apply plugin: 'com.github.jacobono.jaxb'
        dependencies {
            jaxb 'com.sun.xml.bind:jaxb-xjc:2.2.7-b41'
            jaxb 'com.sun.xml.bind:jaxb-impl:2.2.7-b41'
            jaxb 'javax.xml.bind:jaxb-api:2.2.7'
        }
    }
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'android-apt'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

//    dexOptions {
//        maxProcessCount 4
//        javaMaxHeapSize "2g"
//    }

    defaultConfig {
        applicationId "ninja.carre.mbta"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }

    productFlavors {
        instantrunconfig {
            applicationId "ninja.carre.mbta"
            minSdkVersion 21
            targetSdkVersion 23
            versionCode 1
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            signingConfig signingConfigs.debug
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    testOptions {
        unitTests.returnDefaultValues = true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_6
        targetCompatibility JavaVersion.VERSION_1_6
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
}


dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile(
            [group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.0'],
            [group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.8.0'],
            [group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.0']
    )
    // Required -- JUnit 4 framework
    testCompile 'junit:junit:4.12'

    compile group: 'com.google.transit', name: 'gtfs-realtime-bindings', version: '0.0.4'

    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    compile "com.android.support:support-annotations:$build_tools_version"
    compile "com.android.support:appcompat-v7:$build_tools_version"
    compile "com.android.support:support-v4:$build_tools_version"
    compile "com.android.support:support-v13:$build_tools_version"
    compile "com.android.support:cardview-v7:$build_tools_version"
    compile "com.android.support:recyclerview-v7:$build_tools_version"
    compile 'javax.annotation:javax.annotation-api:1.2-b01'
    compile 'com.google.android.gms:play-services-ads:9.4.0'
    compile 'com.google.android.gms:play-services-auth:9.4.0'
    compile 'com.google.android.gms:play-services-gcm:9.4.0'
    compile 'com.google.android.gms:play-services:9.4.0'
    compile 'com.google.maps.android:android-maps-utils:0.4+'
}

在将Realm和Jackson Json解析库添加到我的项目后,我开始遇到此问题。你知道这两个库之间是否存在任何不兼容性?

编辑1 ---按照您的建议并将构建工具更新到最新版本并添加了包类但我仍然收到“InstantRun”配置错误。所以我删除了领域及其依赖项。它仍然在抛出Kotlin构建错误。我分别更新了上面的gradle脚本 ,并在下面留下了gradle构建信息。

C:\Users\carre\Desktop\MBTA_99\MyApplication>gradlew assembleDebug --stacktrace
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html.
Incremental java compilation is an incubating feature.                                                                                                                                                                                                 
:app:preBuild UP-TO-DATE                                        
:app:preInstantrunconfigDebugBuild UP-TO-DATE
:app:checkInstantrunconfigDebugManifest
:app:preInstantrunconfigReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72321Library UP-TO-DATE     
:app:prepareComAndroidSupportCardviewV72321Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72321Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV132321Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2321Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesClearcut940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesContextmanager940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness940Library UP-TO-DATE      
:app:prepareComGoogleAndroidGmsPlayServicesGames940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGass940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlaces940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth940Library UP-TO-DATE      
:app:prepareComGoogleFirebaseFirebaseAuthCommon940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseConfig940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCrash940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabase940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorageCommon940Library UP-TO-DATE
:app:prepareComGoogleMapsAndroidAndroidMapsUtils044Library UP-TO-DATE
:app:prepareInstantrunconfigDebugDependencies
:app:compileInstantrunconfigDebugAidl UP-TO-DATE
:app:compileInstantrunconfigDebugRenderscript UP-TO-DATE
:app:generateInstantrunconfigDebugBuildConfig UP-TO-DATE      
:app:mergeInstantrunconfigDebugShaders UP-TO-DATE
:app:compileInstantrunconfigDebugShaders UP-TO-DATE
:app:generateInstantrunconfigDebugAssets UP-TO-DATE
:app:mergeInstantrunconfigDebugAssets UP-TO-DATE
:app:generateInstantrunconfigDebugResValues UP-TO-DATE
:app:generateInstantrunconfigDebugResources UP-TO-DATE
:app:mergeInstantrunconfigDebugResources UP-TO-DATE      
:app:processInstantrunconfigDebugManifest                 
:app:processInstantrunconfigDebugResources                 
:app:generateInstantrunconfigDebugSources
:app:incrementalInstantrunconfigDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileInstantrunconfigDebugKotlin                 
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class ninja.carre.mbta.activities.train_data.prediction_by_stop.Trip, unresolved supertypes: RealmObject

:app:compileInstantrunconfigDebugKotlin FAILED          

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileInstantrunconfigDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileInstantrunconfigDebugKotlin'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:40)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:237)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.api.GradleException: Compilation error. See log for more details
        at org.jetbrains.kotlin.gradle.tasks.KotlinCompile$callCompiler$10.invoke(Tasks.kt:355)
        at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler(Tasks.kt:364)
        at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler(Tasks.kt:148)
        at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(Tasks.kt:110)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 68 more


BUILD FAILED

Total time: 22.862 secs

2 个答案:

答案 0 :(得分:1)

有一个非常具体的note in the official Realm documentation,如果你使用jackson-databind,你需要创建一个名为rx的包,并在其中创建一个名为{{{ 1}}

Observable

然后它会工作。

虽然你的消息说了" squareup",所以谁知道这实际上是不是问题。

至于上述解决方法,他们尝试使用Realm Optional Transformer删除它,但它导致Dexguard出现问题,因此解决方法仍然存在。

编辑:现在它说它无法解决package rx; public class Observable { }

RealmObject

但您可以尝试添加以下内容

:app:compileInstantrunconfigDebugKotlin                 
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class ninja.carre.mbta.activities.train_data.prediction_by_stop.Trip, unresolved supertypes: RealmObject

禁用即时运行

答案 1 :(得分:0)

尝试更新您的构建工具版本....

compileSdkVersion 23
buildToolsVersion "23.0.3"

或通过SDK Manager下载。