Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ def reactNativeArchitectures() {
}

apply plugin: "com.android.library"
apply plugin: "kotlin-android"
// AGP 9's built-in Kotlin already registers the `kotlin` extension; applying kotlin-android again fails.
if (project.extensions.findByName('kotlin') == null) {
apply plugin: "kotlin-android"
}
apply from: '../nitrogen/generated/android/rive+autolinking.gradle'
apply plugin: "com.facebook.react"

Expand Down Expand Up @@ -122,13 +125,15 @@ android {

sourceSets {
main {
def riveSrcDir = useLegacy ? "src/legacy/java" : "src/new/java"
java.srcDirs += ["generated/java",
"generated/jni"]
if (useLegacy) {
java.srcDirs += ["src/legacy/java"]
} else {
java.srcDirs += ["src/new/java"]
}
"generated/jni",
riveSrcDir]
// AGP 9 built-in Kotlin only compiles kotlin.srcDirs (plus the default
// src/main/java), so register the Kotlin dirs that are only on java.srcDirs,
// including the Nitrogen-generated ones added by rive+autolinking.gradle.
kotlin.srcDirs += [riveSrcDir,
"${project.projectDir}/../nitrogen/generated/android/kotlin"]
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion rive-debug-utils/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ def reactNativeArchitectures() {
}

apply plugin: "com.android.library"
apply plugin: "kotlin-android"
// AGP 9's built-in Kotlin already registers the `kotlin` extension; applying kotlin-android again fails.
if (project.extensions.findByName('kotlin') == null) {
apply plugin: "kotlin-android"
}
apply from: '../nitrogen/generated/android/RiveDebugUtils+autolinking.gradle'

android {
Expand Down
Loading