安装UrbanAirship / Phonegap Gradle问题

时间:2014-12-01 02:50:39

标签: android cordova urbanairship.com

我试图让UrbanAirship在android上使用phonegap应用程序。我在iOS上有插件工作,但在Android上尝试时,每当我尝试运行应用程序时,我都会得到Error:Configuration with name 'default' not found.。我对android不是很熟悉,但我所知道的是,如果我卸载UrbanAirship插件,一切都会正常启动/在手机和模拟器上运行。假设这很容易让我在Android上缺乏经验。任何人都知道从哪里开始?谢谢!

Gradle 'android' project refresh failed
  Error:Configuration with name 'default' not found.

似乎它可能与gradle.build文件有关或缺少其他文件,但添加它们仍会导致错误。下面我从项目的根目录中添加了build.gradle文件的副本,以及urbans phonegap插件添加的目录中的结构/文件的屏幕抓取。

import java.util.regex.Pattern

apply plugin: 'com.android.application'

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.13.2'
    }
}

ext.multiarch=false

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    for (subproject in getProjectList()) {
        compile project(subproject)
    }
}

android {
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }

    defaultConfig {
        versionCode Integer.parseInt("" + getVersionCodeFromManifest() + "0")
    }

    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    if (multiarch || System.env.BUILD_MULTIPLE_APKS) {
        productFlavors {
            armv7 {
                versionCode defaultConfig.versionCode + 2
                ndk {
                    abiFilters "armeabi-v7a", ""
                }
            }
            x86 {
                versionCode defaultConfig.versionCode + 4
                ndk {
                    abiFilters "x86", ""
                }
            }
            all {
                ndk {
                    abiFilters "all", ""
                }
            }
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

}

task wrapper(type: Wrapper) {
    gradleVersion = '1.12'
}

def getVersionCodeFromManifest() {
    def manifestFile = file(android.sourceSets.main.manifest.srcFile)
    def pattern = Pattern.compile("versionCode=\"(\\d+)\"")
    def matcher = pattern.matcher(manifestFile.getText())
    matcher.find()
    return Integer.parseInt(matcher.group(1))
}

def getProjectList() {
    def manifestFile = file("project.properties")
    def pattern = Pattern.compile("android.library.reference.(\\d+)\\s*=\\s*(.*)")
    def matcher = pattern.matcher(manifestFile.getText())
    def projects = []
    while (matcher.find()) {
      projects.add(":" + matcher.group(2).replace("/",":"))
    }
    return projects
}

目录= http://mrtr.co/image/163R0o0d2f18

的屏幕截图

0 个答案:

没有答案