Error:Execution failed for task

2018-08-03  本文已影响156人  明天的天明

不支持Android Studio 3编译

Error:Execution failed for task ':react-native-update:compileDebugNdk'.

Error: Flag android.useDeprecatedNdk is no longer supported and will be removed in the next version of Android Studio. Please switch to a supported build system.
Consider using CMake or ndk-build integration. For more information, go to:
https://d.android.com/r/studio-ui/add-native-code.html#ndkCompile
To get started, you can use the sample ndk-build script the Android
plugin generated for you at:
/Users/duguying/code/opsapp/node_modules/react-native-update/android/build/intermediates/ndk/debug/Android.mk
Alternatively, you can use the experimental plugin:
https://developer.android.com/r/tools/experimental-plugin.html
To continue using the deprecated NDK compile for another 60 days, set
android.deprecatedNdkCompileLease=1509345866453 in gradle.properties

解决方法
https://github.com/midas-gufei/react-native-pushy
已经更新CMakeLists.txt,支持as3.0.

安装使用

  1. 删除主工程android/gradle.properties中的android.useDeprecatedNdk=true,没添加的忽略
  2. 将android/src/main/jni目录改为android/src/main/cpp
  3. 拷贝CMakeLists.txt到android目录下
  4. 覆盖android/build.gradle文件
  5. 点击AndroidStudio工具栏的build/Make Project,在android/build/intermediates/cmake自动生成对应的so文件
上一篇下一篇

猜你喜欢

热点阅读