响应本机fbsdk问题-任务:react-native-fbsdk:compileDebugJavaWithJavac FAILED [英] React native fbsdk issue - Task :react-native-fbsdk:compileDebugJavaWithJavac FAILED
问题描述
安装fbsdk库并按照所有步骤正确链接后,在使用react-native run-android构建我的android文件夹时遇到问题.以下是我的错误消息.
I'm having issues building my android folder with react-native run-android after installing the fbsdk library and following all the steps to properly link it. Below is my error message.
我已经尝试将默认的sdk版本从23更改为27.0.1,这使我有了更详细的错误消息,因为在我构建应用程序失败之前.
I already tried to change my default sdk version from 23 to 27.0.1 which allowed me to have a more detailed error message since before I would only get failed to build aapp.
有什么办法解决这个问题吗?它可以在ios上正常工作.
Any idea how to fix this? It works properly on ios.
> Task :react-native-fbsdk:compileDebugJavaWithJavac FAILED
/Users/hugohyz/code/hugoh1995/dogtime_react/DogtimeReactInit/node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBAppEventsLoggerModule.java:209: error: cannot find symbol
@ReactMethod(isBlockingSynchronousMethod = true)
^
symbol: method isBlockingSynchronousMethod()
location: @interface ReactMethod
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/hugohyz/code/hugoh1995/dogtime_react/DogtimeReactInit/node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/Utility.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-fbsdk:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
76 actionable tasks: 1 executed, 75 up-to-date
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
推荐答案
好,所以我设法解决了与fbsdk相关的问题.显然我在 android/build.graddle
Ok so I managed to fix the fbsdk related issue. Apparently I was missing the following code inside android/build.graddle
allprojects {
repositories {
...
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
...
我现在面临另一个问题,所以我将打开另一个线程.
I'm now faced with another issue tho so I'll open another thread.
重要的是,当显然向存储库中添加新的Maven时,不要替换现有的Maven.
It's important not to replace existing maven when adding new maven to the repositories apparently.
这篇关于响应本机fbsdk问题-任务:react-native-fbsdk:compileDebugJavaWithJavac FAILED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!