Skip to content

Commit

Permalink
fix: improve Android build configuration (#556)
Browse files Browse the repository at this point in the history
* build: set android.disableAutomaticComponentCreation=true

* fix: remove version number from gradle plugin

matches what the react-native init script does currently

* build: add kotlin plugin

Hopefully will fix:

The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
The Kotlin plugin was loaded in the following projects: ':react-native-gesture-handler', ':rnmapbox_maps'

* chore: update package-lock.json
  • Loading branch information
paulschreiber committed Oct 30, 2023
1 parent 44fb75a commit 742d5ef
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
4 changes: 3 additions & 1 deletion dev-client/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.10'

// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
Expand All @@ -16,8 +17,9 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
}

Expand Down
5 changes: 5 additions & 0 deletions dev-client/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ newArchEnabled=false
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

# WARNING:Software Components will not be created automatically for Maven publishing from
# Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property
# android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
android.disableAutomaticComponentCreation=true
36 changes: 18 additions & 18 deletions dev-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 742d5ef

Please sign in to comment.