getExtOrDefault KotlinVersion
See original GitHub issueHi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch react-native-text-input-mask@3.1.4
for the project I’m working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-text-input-mask/android/build.gradle b/node_modules/react-native-text-input-mask/android/build.gradle
index c94f33f..ff67cac 100644
--- a/node_modules/react-native-text-input-mask/android/build.gradle
+++ b/node_modules/react-native-text-input-mask/android/build.gradle
@@ -26,8 +26,8 @@ android {
}
buildscript {
- ext {
- kotlinVersion = '1.4.31'
+ ext.safeExtGet = {prop, fallback ->
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
repositories {
jcenter()
@@ -36,7 +36,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.6.10')}"
}
}
@@ -53,5 +53,5 @@ repositories {
dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'com.redmadrobot:input-mask-android:6.0.0'
- implementation "org.jetbrains.kotlin:kotlin-stdlib:${project.ext.kotlinVersion}"
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:${safeExtGet('kotlinVersion', '1.6.10')}"
}
Issue Analytics
- State:
- Created a year ago
- Reactions:17
- Comments:5
Top Results From Across the Web
https://raw.githubusercontent.com/react-native-com...
buildscript { //Buildscript is evaluated before everything else so we can't use getExtOrDefault def kotlin_version = rootProject.ext.has('kotlinVersion') ?
Read more >Could not resolve all task dependencies for configuration
I am trying to create a react native plugin project. As part of the project, I need to use external artifacts and apply...
Read more >fix checkupdates never runs on MRs (!12042) · Merge requests · F ...
Since CI in the main repository doesn't check everything per se, we should let it do that. This MR exactly matches the original...
Read more >react-native-webview:compileDebugJavaWithJavac FAILED
classpath("com.android.tools.build:gradle:3.6.0") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
Read more >Kotlin 1.5.20 Released! - The JetBrains Blog
Kotlin continues to stay up to date with latest Java features such as dynamic invocations and to provide better interoperability with Java ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you! it worked for me, only had to change the
classpath 'com.android.tools.build:gradle:4.1.3'
toclasspath 'com.android.tools.build:gradle:7.1.1'
too.You should try
cd ios && rm -rf Pods && pod install