找不到com.parse.bolts:bolts-android:1.1.2。手机间隙项目(android studio)?

时间:2023-01-22 17:28:27

I am new in phone gap.integrated facebook plugin in my project .after running error showing

在我的项目中,我是一个新的手机gap.整合的facebook插件。运行错误显示。

`Error:A problem occurred configuring root project 'android'.'

Could not resolve all dependencies for configuration ':_debugCompile'. Could not find com.parse.bolts:bolts-android:1.1.2. Searched in the following locations: file:/C:/Users//AppData/Local/Android/sdk/extras/android/m2repository/com/parse/bolts/bolts-android/1.1.2/bolts-android-1.1.2.pom file:/C:/Users//AppData/Local/Android/sdk/extras/android/m2repository/com/parse/bolts/bolts-android/1.1.2/bolts-android-1.1.2.jar file:/C:/Users//AppData/Local/Android/sdk/extras/google/m2repository/com/parse/bolts/bolts-android/1.1.2/bolts-android-1.1.2.pom file:/C:/Users//AppData/Local/Android/sdk/extras/google/m2repository/com/parse/bolts/bolts-android/1.1.2/bolts-android-1.1.2.jar Required by: :android:unspecified > com.facebook.android:FacebookLib:3.21.1

无法解析配置':_debugCompile'的所有依赖项。找不到com.parse.bolts:bolts-android:1.1.2。在以下位置进行搜索:文件:/C:/用户//AppData/本地/Android/sdk/附加/Android/ m2repository/ Android/ m2repository/ bolts/bolts/bolts - Android -1.1.2。pom文件:C:/用户/ / AppData /地方/ Android / sdk /配件/ Android / m2repository /com/parse/bolts/bolts-android/1.1.2/bolts-android-1.1.2。jar文件:C:/用户/ / AppData /地方/ Android / sdk /配件/谷歌/ m2repository /com/parse/bolts/bolts-android/1.1.2/bolts-android-1.1.2。pom文件:C:/用户/ / AppData /地方/谷歌Android / sdk /配件/ / m2repository /com/parse/bolts/bolts-android/1.1.2/bolts-android-1.1.2。需要的jar::android:未指定的> com.facebook.android:FacebookLib:3.21.1。

pls help me.

请帮助我。

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
}

2 个解决方案

#1


5  

Try it may be helpful.

尝试一下也许会有帮助。

Failed to resolve : compile 'com.parse.bolts:bolts-android:1.+'

未能解决:编译'com. parse.螺栓:bolts-android:1.+'

Go to menu : File -> Settings - > Build, Execution, Deployment - > Build Tools -> Gradle

进入菜单:文件->设置->构建,执行,部署->构建工具->等级。

In - Project-level-setting

——Project-level-setting

Checked or select- User default gradle wrapper(recommended)

选中或选择-用户默认的gradle包装器(推荐)

and

In - Global Gradle Setting

In - Global Gradle Setting。

Disable offline Work

禁用脱机工作

#2


2  

You're missing the repositories declaration in your script. What you do have is the repositories in buildscript closure, that configures the build itself (e.g. to find the Android plugin needed for the build to run), but you don't have a repositories declaration that will bring the dependencies your classes need. Please add

您在脚本中丢失了存储库声明。您所拥有的是buildscript闭包中的存储库,它配置了构建本身(例如,为了找到构建运行所需的Android插件),但是您没有一个存储库声明,它将带来您的类需要的依赖项。请添加

repositories {
   jcenter()
}

That should do the trick.

这就够了。

#1


5  

Try it may be helpful.

尝试一下也许会有帮助。

Failed to resolve : compile 'com.parse.bolts:bolts-android:1.+'

未能解决:编译'com. parse.螺栓:bolts-android:1.+'

Go to menu : File -> Settings - > Build, Execution, Deployment - > Build Tools -> Gradle

进入菜单:文件->设置->构建,执行,部署->构建工具->等级。

In - Project-level-setting

——Project-level-setting

Checked or select- User default gradle wrapper(recommended)

选中或选择-用户默认的gradle包装器(推荐)

and

In - Global Gradle Setting

In - Global Gradle Setting。

Disable offline Work

禁用脱机工作

#2


2  

You're missing the repositories declaration in your script. What you do have is the repositories in buildscript closure, that configures the build itself (e.g. to find the Android plugin needed for the build to run), but you don't have a repositories declaration that will bring the dependencies your classes need. Please add

您在脚本中丢失了存储库声明。您所拥有的是buildscript闭包中的存储库,它配置了构建本身(例如,为了找到构建运行所需的Android插件),但是您没有一个存储库声明,它将带来您的类需要的依赖项。请添加

repositories {
   jcenter()
}

That should do the trick.

这就够了。