I’ve created a brand new project using npx react-native init my-project --version 0.73.0
. This command creates a gradle 8 and kotlin 1.8 project.
Then, added to app/build.gradle
the following dependency:
implementation("io.card:android-sdk:5.5.1")
Then, added to MainApplication.kt
the following line of code at onCreate method:
println(R.drawable.cio_ic_discover)
(This drawable resource comes from io.card:android-sdk
dependency)
When running the command below (or build → rebuild project) over a jdk 17:
./gradlew build
… this error is raised:
> Task :app:compileDebugKotlin FAILED
e: file:///home/garry/my-project/MainApplication.kt:39:24 Unresolved reference: cio_ic_discover
It means the resource inside this dependency cannot be resolved under gradle 8 and kotlin 1.8.
This problem does not occurs using gradle 7 and kotlin 1.7.
Note:
#1 when I change println(R.drawable.cio_ic_discover)
to println(io.card.payment.R.drawable.cio_ic_discover)
everything works fine but it does no make sense for me and I did not find any release note that explains it.
#2 already tried all sort of cleans and caches cleaning available in or out android studio