react-native-android-open-settings
react-native-android-open-settings copied to clipboard
Could not find method implementation() for arguments [com.facebook.react:react-native:+]
"react-native": "^0.54.3",
"react-native-android-open-settings": "^1.2.0",
- What went wrong: A problem occurred evaluating project ':react-native-android-open-settings'.
Could not find method implementation() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
in node_modules/react-native-android-open-settings/android/build.gradle
modify
dependencies {
implementation 'com.facebook.react:react-native:+'
}
to
dependencies {
compile 'com.facebook.react:react-native:+'
}
and it works
I've had a bit different error message, but it helped, thanks!
MainApplication.java:6: error: package com.levelasquez.androidopensettings does not exist
import com.levelasquez.androidopensettings.AndroidOpenSettingsPackage;
^
MainApplication.java:59: error: cannot find symbol
new AndroidOpenSettingsPackage(),
^
symbol: class AndroidOpenSettingsPackage
@leeleoo but when you install your packages again or update them, your local change will be gone. You are using an older Android API level, right?
@donni106 That's why I made a fork, but now that I think about it a patch would be probably a better idea. AFAIK this is problem in gradle, not Android API level. compile
is deprecated since gradle version 3, and I'm currently using 2.3.3 (classpath 'com.android.tools.build:gradle:2.3.3'
in android/build.gradle
)
Yes sure, gradle version, not Android API level, my fault.
@donni106 yes and I update gradle version to 3.x