Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile time issue #126

Closed
sdoward opened this issue Apr 4, 2019 · 9 comments
Closed

Compile time issue #126

sdoward opened this issue Apr 4, 2019 · 9 comments
Labels
type:question A question about Acorn

Comments

@sdoward
Copy link
Contributor

sdoward commented Apr 4, 2019

I am trying to use this lib in a current project. When building I receive the error below. This happens during the kaptDebugKotlin task

e: error: compiler message file broken: key=compiler.err.Processor: org.jetbrains.kotlin.kapt3.base.ProcessorWrapper@28db3c9f arguments={0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}
e: error: cannot access AcornAppCompatActivity
  class file for com.nhaarman.acorn.android.AcornAppCompatActivity not found
  Consult the following stack trace for details.
  com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.nhaarman.acorn.android.AcornAppCompatActivity not found
@Zhuinden
Copy link

Zhuinden commented Apr 4, 2019

Interesting, because it's here

@nhaarman
Copy link
Owner

nhaarman commented Apr 4, 2019

Hm, Acorn doesn't use annotation processing itself so I'm thinking it's a misconfiguration on your end. Could you share some of your config? Did you use the com.nhaarman.acorn.ext:acorn-android-appcompat artifact for example?

It's also funny that a Google search for the error results in at least two pages where @Zhuinden contributed 😅

@sdoward
Copy link
Contributor Author

sdoward commented Apr 4, 2019

@Zhuinden gradle doesn't look at github to find source code.

@nhaarman yes I recognise this might be some config issue on my side.

Yes I am using that artefact. My config looks like this...

import org.jetbrains.kotlin.gradle.internal.AndroidExtensionsExtension
import org.sharethemeal.dependencies.AndroidSdk
import org.sharethemeal.dependencies.Libraries
import org.sharethemeal.dependencies.ReleaseConfig

plugins {
    id("com.android.library")
    id("kotlin-android")
    id("kotlin-android-extensions")
}


android {
    compileSdkVersion(AndroidSdk.compileSdk)

    defaultConfig {
        minSdkVersion(AndroidSdk.minSdk)
        targetSdkVersion(AndroidSdk.targetSdk)
        versionCode = ReleaseConfig.instantVersionCode
        versionName = ReleaseConfig.appVersionName
        renderscriptTargetApi = AndroidSdk.targetSdk
        vectorDrawables.useSupportLibrary = true
        renderscriptSupportModeEnabled = true
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    buildTypes {
        getByName("release") {
            isMinifyEnabled = false
            proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
        }
    }

    lintOptions {
        setLintConfig(file("../qualityconfigs/lint.xml"))
    }

}

androidExtensions {
    configure(delegateClosureOf<AndroidExtensionsExtension> {
        isExperimental = true
    })
}


dependencies {
    implementation(project(":core"))


    implementation ("com.nhaarman.acorn.ext:acorn-android-appcompat:0.11.6")
    implementation(Libraries.appCompat)
    kapt(Libraries.daggerCompiler)
    implementation(Libraries.dagger)
    kapt(Libraries.daggerAndroidCompiler)
    implementation(Libraries.cardView)
    implementation(Libraries.daggerAndroid)
    implementation(Libraries.kotlinStdlib)
    implementation(Libraries.androidBound)
    implementation(Libraries.rxJava)
    implementation(Libraries.joda)

    testImplementation(Libraries.junit)
    testImplementation(Libraries.mockitoKotlin)
}

One issue I had before this is that we don't use isExperimental = true from kotlin-android-extensions so I had to add that config (maybe you can include that in the readme)

@Zhuinden
Copy link

Zhuinden commented Apr 4, 2019

Does core have a different version of Acorn?

I see this is library module, maybe you need api("com.nhaarman.acorn.ext:acorn-android-appcompat:0.11.6")?

@sdoward
Copy link
Contributor Author

sdoward commented Apr 4, 2019

core doesn't use acorn only this module

@Zhuinden
Copy link

Zhuinden commented Apr 4, 2019

Did you try changing implementation to api?

@nhaarman
Copy link
Owner

nhaarman commented Apr 7, 2019

@sdoward did you make any progress on this? If not, would it be possible to reproduce the issue in an MVCE?

@nhaarman nhaarman added the type:question A question about Acorn label Apr 7, 2019
@sdoward
Copy link
Contributor Author

sdoward commented Apr 8, 2019

@Zhuinden surprisingly your suggestion works.

@nhaarman I will try if I find some spare time.

@nhaarman
Copy link
Owner

nhaarman commented May 8, 2019

Closing this issue for now. If you still find any difficulties, don't hesitate to open a new one.

@nhaarman nhaarman closed this as completed May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question A question about Acorn
Projects
None yet
Development

No branches or pull requests

3 participants