gpt4 book ai didi

java - Android gradle 错误 :(69, 0) Gradle DSL 方法未找到: 'compile()'

转载 作者:行者123 更新时间:2023-12-02 13:09:05 24 4
gpt4 key购买 nike

我的 build.gradle 文件遇到了这个非常令人沮丧的问题。当我决定向我的项目添加新库时,它就开始了:“Deter-master”lib。

这是错误消息:

Gradle sync failed: Could not find method compile() for arguments [com.android.support:appcompat-v7:25.0.0] on DefaultExternalModuleDependency{group='com.android.support', name='support-v13', version='25.0.0', configuration='default'} of type org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency. Consult IDE log for more details (Help | Show Log)

下面你可以看到所有的gradle文件:

apply plugin: 'com.android.application'

ext {
libraries = [
support : "25.0.0",
location: "9.8.0"
]
}
def config = project.ext.libraries


repositories {
mavenCentral()
mavenLocal()
flatDir {
dirs 'libs'
}
maven { url 'https://maven.fabric.io/public' }
}
repositories {
maven {
url 'https://dl.bintray.com/blipinsk/maven/'
}
}

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"

defaultConfig {
applicationId "com.airnauts.kaktus"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
signingConfigs {
debug {
storeFile file("../social_keystore.jks")
storePassword "social"
keyAlias "social"
keyPassword "social"
}
release {
storeFile file("../social_keystore.jks")
storePassword "social"
keyAlias "social"
keyPassword "social"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

android {
packagingOptions {
exclude 'LICENSE.txt'
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile(name: 'toolkit', ext: 'aar')
compile "com.android.support:support-v13:${config.support}" compile "com.android.support:appcompat-v7:${config.support}" compile "com.android.support:support-v4:${config.support}" compile "com.android.support:recyclerview-v7:${config.support}" compile "com.android.support:design:${config.support}" compile "com.android.support:cardview-v7:${config.support}" compile "com.android.support:percent:${config.support}" compile "com.google.android.gms:play-services-location:${config.location}" compile "com.google.android.gms:play-services-maps:${config.location}"
//blipinsk
compile 'com.firebaseui:firebase-ui-auth:0.6.2'
compile 'com.bartoszlipinski:viewpropertyobjectanimator:1.2.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton:butterknife:7.0.0'
compile 'com.makeramen:roundedimageview:2.2.0'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'me.kaelaela:verticalviewpager:1.0.0@aar'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.firebase:firebase-auth:9.8.0'
compile 'com.firebaseui:firebase-ui:1.0.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.karumi:dexter:4.1.0'
compile project('Libraries:Dexter-master')
}

apply plugin: 'com.google.gms.google-services'

另一部分:

// 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'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}

allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
}

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

最后一个:

include ':app'
include ':app:Libraries:Dexter-master'

最佳答案

尝试替换:

compile "com.android.support:support-v13:${config.support}" compile "com.android.support:appcompat-v7:${config.support}" compile "com.android.support:support-v4:${config.support}" compile "com.android.support:recyclerview-v7:${config.support}" compile "com.android.support:design:${config.support}" compile "com.android.support:cardview-v7:${config.support}" compile "com.android.support:percent:${config.support}" compile "com.google.android.gms:play-services-location:${config.location}" compile "com.google.android.gms:play-services-maps:${config.location}"

与:

compile "com.android.support:support-v13:${config.support}"
compile "com.android.support:appcompat-v7:${config.support}"
compile "com.android.support:support-v4:${config.support}"
compile "com.android.support:recyclerview-v7:${config.support}"
compile "com.android.support:design:${config.support}"
compile "com.android.support:cardview-v7:${config.support}"
compile "com.android.support:percent:${config.support}"
compile "com.google.android.gms:play-services-location:${config.location}"
compile "com.google.android.gms:play-services-maps:${config.location}"

关于java - Android gradle 错误 :(69, 0) Gradle DSL 方法未找到: 'compile()',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44028763/

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