gpt4 book ai didi

android - 找不到方法android()

转载 作者:行者123 更新时间:2023-12-03 05:31:53 25 4
gpt4 key购买 nike

错误日志:

ERROR: Could not find method android() for arguments [build_szu6u1qudhn719nxb58vfd0f$_run_closure1@1fcc37a7] on root project 'prueva2'.



这是我的build.gradle:
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'

defaultConfig {
applicationId 'com.MyApp'
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "1.0"
}

lintOptions {
abortOnError false
}

buildscript {
repositories {
google() // For Gradle 4.0+
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'

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

allprojects {
repositories {
jcenter()
maven
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
}

gradle-wrapper.properties:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zip

任何解决方案可能是什么问题?

最佳答案

您使用的错误的 build.gradle文件。

您无法在顶级文件中定义androidt块

您有来删除这部分在您的

android {
compileSdkVersion 19
buildToolsVersion '25.0.2'
dexOptions {
incremental true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
}
dependencies {compile files('app/libs/junit-4.12-JavaDoc.jar')
}
apply plugin: 'maven'

关于android - 找不到方法android(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58896129/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com