Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 552 Vote(s) - 3.62 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'Unresolved reference' errors for android library module referenced in app module

#1
I have problems referencing my android library modules in my projects. Beside the main app module I use to have an android library module with either util stuff or as data module. I reference it in app module like that:

dependencies {
implementation project(":data")
}

When I build the project, it´s giving me lot of error messages `'Unresolved reference: ...'` for all stuff that I reference in the app module to the android library module. But the IDE itself doesn´t have a problem, Intelligent finds all classes, interfaces etc., imports are fine, nothing is red. The android library module itself builds and creates `aar-file` in the output. It´s the `compileDebugKotlin` task that fails

Any general idea what may be related to that?
Reply

#2
Found the problem, my android library module was missing the kotlin configuration:

apply plugin: 'kotlin-android'

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion:<version>"
}

Although I used kotlin .kt files in it, it could build without and also

`Tools -> Kotlin -> 'Configure Kotlin in projects'`

had told me **'All modules with Kotlin files are configured'**
Reply

#3
Your module's `build.gradle` file should have:

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

dependencies {
...
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
...
}
Reply

#4
If it is a ```kotlin``` module make sure to add in its `build.gradle` file

`apply plugin: 'kotlin'`
Reply

#5
In my case It was `apply plugin: 'kotlin-android'`,

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
and also added it on build.gradle

androidExtensions {
experimental = true
}

Reply

#6
I was using CoroutineWorkers and in my case I had to add **work-runtime-ktx** dependency to use it

implementation "androidx.work:work-runtime-ktx:2.4.0"
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through