我正在尝试构建一个从github克隆的react-native项目。 Here is the github project。
在npm install
之后。我尝试了react-native run-android
,我明白了:
/var/www/html/test/sipsip/react-native-pjsip-app/node_modules/react-native-pjsip/android/src/main/java/com/carusto/ReactNativePjSip/PjSipModulePackage.java:12: error: PjSipModulePackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class PjSipModulePackage implements ReactPackage {
^
/var/www/html/test/sipsip/react-native-pjsip-app/node_modules/react-native-pjsip/android/src/main/java/com/carusto/ReactNativePjSip/PjActions.java:307: error: cannot find symbol
value.put(mapKey, map.getArray(mapKey).toArrayList());
^
symbol: method toArrayList()
location: interface ReadableArray
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
:react-native-pjsip:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-pjsip:compileReleaseJavaWithJavac'.
> 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.
BUILD FAILED
Total time: 24.355 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
我尝试了许多解决方案,但没有一个解决了我的问题。您知道如何解决此问题吗?
其他信息:
本机版本:
react-native-cli: 2.0.1
react-native: 0.41.2
答案 0 :(得分:0)
我今天也面临着同样的问题,仅通过使用该项目更新我的react-native就解决了
react-native-git-upgrade
如果尚未安装(升级程序),可以致电
npm install -g react-native-git-upgrade
当然,有数千个要更新的gradle,.js文件失败(仍在工作),但至少,我已经通过了您描述的失败。
答案 1 :(得分:0)
删除/ ios和/ android文件夹
然后运行react-native eject