gpt4 book ai didi

java - Build.Gradle Error (22,0) 找不到方法 chandroid()

转载 作者:行者123 更新时间:2023-11-30 10:29:38 24 4
gpt4 key购买 nike

我是 Android Studio 的新手,我已经完成了我的简单应用程序。但问题是我在将应用程序文件夹从桌面复制到笔记本电脑后尝试打开项目时遇到 Gradle 问题。(包括截图链接以便更好地理解问题)

主 Build.Gradle http://puu.sh/vQl8c/bcade1a2e2.png

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// 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
}

//不需要//机器人 {//compileSdkVersion 19//

应用构建.等级 http://puu.sh/vQl9v/e7363ddb74.png

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
applicationId "com.afinal.eaglearms.learnk"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

externalNativeBuild {
cmake {
cppFlags ""
}
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
exclude group: 'com.android.support', module: 'support-annotations'
}
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.3.1'
}

最佳答案

chandroid {
compileSdkVersion 19
}

从您的主/根 build.gradle 文件中删除它。它应该是 android 而不是 chandroid,这也不是必需的,因为你已经在应用程序模块的 build.gradle 中定义了。

关于java - Build.Gradle Error (22,0) 找不到方法 chandroid(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43971035/

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