Skip to content

Commit 7773976

Browse files
meghancampbel9facebook-github-bot
authored andcommitted
fix issue #51297 which addresses allWarningsAsErrors type error (#51300)
Summary: Resolved a build error [issue https://github.com/facebook/react-native/issues/51297](https://github.com/facebook/react-native/issues/51297) caused by assigning a Boolean to a Property<Boolean>. Switched from direct assignment to using .set(...) to correctly configure allWarningsAsErrors from project properties. ## Changelog: - Gradle fix: assign allWarningsAsErrors using .set() for Property<Boolean> <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - [ANDROID] [FIXED] For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Pull Request resolved: #51300 Test Plan: Fixes build failure with React Native v0.79.2 and Gradle v8.0. ``` npm run start npm run android ``` no more build errors Reviewed By: cortinico Differential Revision: D74706741 Pulled By: rshest fbshipit-source-id: 31ec923f49a6da63fb5abb464bc38b99b1e8650a
1 parent 7f8b656 commit 7773976

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

packages/gradle-plugin/react-native-gradle-plugin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ tasks.withType<KotlinCompile>().configureEach {
6666
apiVersion.set(KotlinVersion.KOTLIN_1_8)
6767
// See comment above on JDK 11 support
6868
jvmTarget.set(JvmTarget.JVM_11)
69-
allWarningsAsErrors =
70-
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
69+
allWarningsAsErrors.set(
70+
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false)
7171
}
7272
}
7373

packages/gradle-plugin/settings-plugin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ tasks.withType<KotlinCompile>().configureEach {
5656
apiVersion.set(KotlinVersion.KOTLIN_1_8)
5757
// See comment above on JDK 11 support
5858
jvmTarget.set(JvmTarget.JVM_11)
59-
allWarningsAsErrors =
60-
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
59+
allWarningsAsErrors.set(
60+
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false)
6161
}
6262
}
6363

packages/gradle-plugin/shared-testutil/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ tasks.withType<KotlinCompile>().configureEach {
2727
apiVersion.set(KotlinVersion.KOTLIN_1_8)
2828
// See comment above on JDK 11 support
2929
jvmTarget.set(JvmTarget.JVM_11)
30-
allWarningsAsErrors =
31-
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
30+
allWarningsAsErrors.set(
31+
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false)
3232
}
3333
}
3434

packages/gradle-plugin/shared/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ tasks.withType<KotlinCompile>().configureEach {
3333
apiVersion.set(KotlinVersion.KOTLIN_1_8)
3434
// See comment above on JDK 11 support
3535
jvmTarget.set(JvmTarget.JVM_11)
36-
allWarningsAsErrors =
37-
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
36+
allWarningsAsErrors.set(
37+
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false)
3838
}
3939
}
4040

0 commit comments

Comments
 (0)