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"
}
    原文作者:NO我的错
    原文地址: https://www.jianshu.com/p/d56e22da1c69
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞