运行错误显示后,我是我的项目中新的手机gap.integrated facebook插件的新手
`Error:A problem occurred configuring root project 'android'.'
请帮助我。
import java.util.regex.Pattern
apply plugin: 'android'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
compile 'com.parse.bolts:bolts-android:1.1.2'
}
}
ext.multiarch=false
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
for (subproject in getProjectList()) {
compile project(subproject)
}
compile files('com.phonegap.plugins.facebookconnect/FacebookLib/libs/bolts-android-1.1.2.jar')
}
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 19
buildToolsVersion "19.1.0"
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
}
最佳答案
尝试它可能会有所帮助。
无法解决:compile 'com.parse.bolts:bolts-android:1.+'
转到菜单:文件->设置->构建,执行,部署->构建工具-> Gradle
输入-项目级别设置
选中或选择-用户默认的Gradle包装器(推荐)
和
在-全局Gradle设置中
停用离线工作
关于android - 找不到com.parse.bolts :bolts-android:1. 1.2。在手机差距项目(Android Studio)中?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27763865/