gpt4 book ai didi

android - 无法为类型为 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 的对象获取未知属性 'classpath'

转载 作者:太空宇宙 更新时间:2023-11-03 11:29:08 25 4
gpt4 key购买 nike

我正在为 Android 设备构建 Ionic 应用程序。我的 gradle 版本是 3.3。我是这个 Android 建筑的新手。我收到以下错误:

Build file 'E:\FarmApp\smartFarm\platforms\android\build.gradle' line: 33

* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not get unknown property 'classpath' for object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

我的 build.gradle 文件部分如下

 buildscript {
repositories {
mavenCentral()
jcenter()
}

// Switch the Android Gradle plugin version requirement depending on the
// installed version of Gradle. This dependency is documented at
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3',
classpath 'com.google.gms:google-services:3.1.0'
}
}

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
repositories {
mavenCentral();
jcenter()
}
}

task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
}

最佳答案

删除类路径末尾的逗号。这对我有用。

dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.1.0'
}

关于android - 无法为类型为 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 的对象获取未知属性 'classpath',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45658065/

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