2

我将使用 react native 创建一个 http 服务器,其工作是响应许多 API。根据我的研究,我发现这可以使用两个包react-native-http-bridgereact-native-http-server来完成。安装这些包并将它们链接到程序(自动和手动)并启动程序后,我遇到以下错误。如果您知道此问题的解决方案或有其他解决方案可以实现我想要做的事情,请指导我。 在此处输入图像描述

4

1 回答 1

0

在 react-native-http-bridge/android/build.gradle 中进行此更改

dependencies {
    compile 'com.facebook.react:react-native:+'
    -compile 'com.google.android.gms:play-services-gcm:+'
    +compile 'com.google.android.gms:play-services-gcm:16.1.0'
    compile 'org.nanohttpd:nanohttpd:2.3.1'
}

看看这里:https ://github.com/alwx/react-native-http-bridge/commit/a6c2c705561250198fc601a92b0d2579ec50fe11

于 2021-03-26T13:47:00.040 回答