React-Native 学习之路 - 极光消息推送Could not find method api()... 错误修正

在0.55 .4 中错误:Could not find method api() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

node_modules/jpush-react-native/android/build.gradle
node_modules/jcore-react-native/android/build.gradle
两个组件中 api 和 implementation 换成 compile

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs') 
  compile 'com.facebook.react:react-native:+'
}

android/app/build.gradle 中 implementation 换成 compile

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile project(':jpush-react-native')  // 添加 jpush 依赖
    compile project(':jcore-react-native')  // 添加 jcore 依赖
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile "com.android.support:appcompat-v7:23.0.1"
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容