【问题标题】:I am not able to sync my android project as it was build on another PC. How to solve it?我无法同步我的 android 项目,因为它是在另一台 PC 上构建的。如何解决?
【发布时间】:2016-08-26 19:22:08
【问题描述】:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript [poiu{
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

【问题讨论】:

  • buildscript [poiu{中删除[poiu,应该是buildscript {

标签: android gradle build.gradle


【解决方案1】:
buildscript **[poiu**{
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

注意用 * 包裹的代码——那里的代码应该是完全没有 [poui 的 buildscript。

至于这是怎么发生的;可能是复制粘贴错误(粘贴到错误的位置),也可能是意外的代码编写。关键是要修复它。 Gradle 构建错误没有那么详细,IDE 不会以与 java(或 C++ 等)编译器和 IDE 显示错误相同的方式显示错误。

【讨论】:

    猜你喜欢
    • 2020-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-25
    • 2019-03-20
    • 1970-01-01
    • 2013-11-15
    • 1970-01-01
    相关资源
    最近更新 更多