我尝试安装的模块是react-native-schedule-sms
SchduleSMSDemo app存储库中提供的react-native-schedule-sms项目&运行良好没有任何问题
我的应用名称为<div class="shape">
</div>
&amp;完整的错误是
birthdayReminder
我有Scanning 734 folders for symlinks in /Volumes/Coding/Code/ReactNative/birthdayReminder/node_modules (13ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Incremental java compilation is an incubating feature.
FAILURE: Build failed with an exception.
* Where:Build file '/Volumes/Coding/Code/ReactNative/birthdayReminder/node_modules/react-native-schedule-sms/android/build.gradle' line: 17
* What went wrong:
A problem occurred evaluating project ':react-native-schedule-sms'.> Could not find method implementation() for arguments [com.facebook.react:react-native:+] on objectof type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7.77 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
作为原生依赖&amp; realm
&amp;两者都在react-native-schedule-sms
安装了两个&amp;后我做了settings.gradle
如果我删除react-native link
react-native-schedule-sms
rootProject.name = 'birthdayReminder'
include ':realm'
project(':realm').projectDir = new File(rootProject.projectDir, '../node_modules/realm/android')
include ':react-native-schedule-sms'
project(':react-native-schedule-sms').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-schedule-sms/android')
include ':app'
答案 0 :(得分:1)
这可能是模块的gradle而不是你的问题。尝试检查&#39; /node_modules/react-native-schedule-sms/android/build.gradle'第17行的文件。检查它是否正在使用&#39;实施&#39;而不是编译&#39;。如果有,请更换它们。