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

Gradle dependency issue in java module #158

Open
VincentJian opened this issue Jan 2, 2020 · 4 comments
Open

Gradle dependency issue in java module #158

VincentJian opened this issue Jan 2, 2020 · 4 comments

Comments

@VincentJian
Copy link

VincentJian commented Jan 2, 2020

Cannot resolve reference com.nhaarman.acorn.presentation.Container class when using in pure java module.

Steps to reproduce:

  1. Create empty activity project using Android Studio wizard
  2. Create module Java Library
  3. Add implementation 'com.nhaarman.acorn.ext:acorn:1.2.0' to the java module in build.gradle file
  4. Create any interface that extends com.nhaarman.acorn.presentation.Container will see the error.

Found a similar issue on StackOverflow. Maybe it is gradle issue then.

@nhaarman
Copy link
Owner

nhaarman commented Feb 2, 2020

Hi @VincentJian, I was unable to reproduce this. Is this still an issue?

@VincentJian
Copy link
Author

Yes, it is still an issue. This issue only happens in pure java module. In the last step, I mean create the interface in the java module.

@programadorthi
Copy link

I followed your steps and I had no errors. I implemented both no .ext and .ext versions. I think you have a broken gradle version or you IDE needs clear cache.

@VincentJian
Copy link
Author

VincentJian commented Jun 18, 2020

I tried again with gradle 6.5 with Android Studio 4.0 and still see this issue. I also tried invalidate and restart the IDE.
Here is the build.gradle file in my pure java module.

apply plugin: "java-library"
apply plugin: "kotlin"

compileKotlin {
  kotlinOptions.jvmTarget = "1.8"
}

dependencies {
  implementation fileTree(dir: "libs", include: ["*.jar"])
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
  implementation "com.nhaarman.acorn.ext:acorn:1.2.4"
}

Anyway, I convert this pure java module to android library module and this issue is gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants