我的android工作室找不到编译方法(com.android.support.constraint:constraint-layout:1.0.0-beta4)

时间:2017-12-09 09:18:57

标签: android android-layout android-gradle android-constraintlayout

我在Android Studio中遇到此问题,我在build.gradle文件中添加了此问题,但我遇到了这个问题。

  

错误:(13,0)无法在类型为org.gradle.api.internal的对象上找到参数[com.android.support.constraint:constraint-layout:1.0.0-beta4]的方法compile()。 artifacts.dsl.dependencies.DefaultDependencyHandler。

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

    buildscript {

     repositories {
        google()
        jcenter()

     }
     dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        compile'com.android.support.constraint:constraint-layout:1.0.0-beta4'                                
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
     }
    }

    allprojects {
     repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com'
        }
     }
    }

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

2 个答案:

答案 0 :(得分:0)

Beta 4是旧版本。请尝试使用1.0.2

compile 'com.android.support.constraint:constraint-layout:1.0.2'  

答案 1 :(得分:0)

删除这一行:

from struct import pack, unpack

print unpack( "d", pack( "Q", 4631069437225598976 ) )[ 0 ]
print unpack( "d", pack( "Q", 13829563286724542464 ) )[ 0 ]

无法在顶级文件中添加依赖项,您也无法在41.7274742126 -0.889958143234 块中使用此依赖项。