Reputation: 358
I am unable to run react native android app after update of android gradle to "classpath 'com.android.tools.build:gradle:3.6.3'" and added "kotlin_version='1.6.0'".
**My android --> build.gradle **
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 19
compileSdkVersion = 31
targetSdkVersion = 31
googlePlayServicesAuthVersion = "16.0.1"
kotlin_version='1.6.0' //add This change version with your installed kotlin version
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" //add This
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral()
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
** Facing Error **
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings 608 actionable tasks: 2 executed, 606 up-to-date Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> More than one file was found with OS independent path 'lib/armeabi-v7a/libfbjni.so'
I added kotlin version and change gradle to "3.6.3" , I expected that it will run after added kotlin and gradle version changes but i am unable to open app.
Upvotes: 1
Views: 351
Reputation: 515
Add this in the allprojects area of your android/buld.gradle file.
def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
allprojects {
configurations.all {
resolutionStrategy {
// Remove this override in 0.65+, as a proper fix is included in react-native itself.
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
Upvotes: 0