Cordova Android构建失败:未找到名称为“debug”的配置

时间:2016-12-12 10:49:06

标签: android cordova phonegap-plugins cordova-plugins facebook-android-sdk

phonegap-facebook-plugin添加到我的Cordova项目,并为android构建项目后,它失败并显示错误:

  

无法评估模块FacebookLib:未找到名称为“debug”的配置

我的android项目结构如下所示:

android
  --> CordovaLib
        --> build.gradle
  --> phonegap-facebook-plugin
        --> chooze-FacebookLib
              --> build.gradle
  --> build.gradle
  --> settings.gradle

build.gradle文件包含:

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    debugCompile(project(path: "CordovaLib", configuration: "debug"))
    releaseCompile(project(path: "CordovaLib", configuration: "release"))
    debugCompile(project(path: "phonegap-facebook-plugin:FacebookLib", configuration: "debug"))
    releaseCompile(project(path: "phonegap-facebook-plugin:FacebookLib", configuration: "release"))
    // SUB-PROJECT DEPENDENCIES END
}

settings.gradle

// GENERATED FILE - DO NOT EDIT
include ":"
include ":CordovaLib"
include ":phonegap-facebook-plugin:FacebookLib"
project(":phonegap-facebook-plugin:FacebookLib").projectDir = new File("phonegap-facebook-plugin/chooze-FacebookLib")

我似乎没有找到任何可以解决这个问题的解决方案。我很感激任何建议。谢谢!

1 个答案:

答案 0 :(得分:1)

在尝试了这么多解决方案之后,我通过使用另一个插件解决了这个问题,这是cordova-plugin-facebook4 - 官方插件的分叉版本。像魅力一样工作!