gpt4 book ai didi

android - Gradle 同步失败 : ERROR: Expected ':' at line 1 column 11 path $. 请

转载 作者:行者123 更新时间:2023-12-02 04:20:41 25 4
gpt4 key购买 nike

当我打开一个这个 android 项目但是当它想要构建一个项目时它说这个
here the error

关键是我从未更改过我的 gradle 文件。

我已使缓存无效并重新启动 Android Studio。

但它没有用。

我不知道是什么导致了这个问题。这里有人可以帮助我吗?

这是日志:

org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:processDebugGoogleServices'.
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugGoogleServices'.
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected ':' at line 1 column 11 path $.please
at com.google.gson.internal.Streams.parse(Streams.java:60)
at com.google.gson.JsonParser.parse(JsonParser.java:84)
at com.google.gson.JsonParser.parse(JsonParser.java:59)
at com.google.gms.googleservices.GoogleServicesTask.action(GoogleServicesTask.java:163)
Caused by: com.google.gson.stream.MalformedJsonException: Expected ':' at line 1 column 11 path $.please
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1568)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:530)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:700)
at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:723)
at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:698)
at com.google.gson.internal.Streams.parse(Streams.java:48)

gradle.build 文件:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
}
//apply plugin: 'android-apt'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.st.jobportal"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.google.code.gson:gson:2.8.6'
}
apply plugin: 'com.google.gms.google-services'

最佳答案

试试这个:

(项目级别)

buildscript {
repositories {
google() // Google's Maven repository
jcenter()
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.google.gms:google-services:4.3.3' // Google Services plugin
}
}

allprojects {
repositories {
google() // Google's Maven repository
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}

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

(模块级)
apply plugin: 'com.android.application'

apply plugin: 'io.fabric'

//apply plugin: 'android-apt'

android {
compileSdkVersion 29
defaultConfig {
applicationId "com.st.jobportal"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.google.code.gson:gson:2.8.6'
}
apply plugin: 'com.google.gms.google-services'

我认为您不需要 Fabric,因为您不使用 Crashlytics 或 Fabric。

如果失败,则 Invalid & Clean。如果它成功了,只有你可以尝试的方法是

关于android - Gradle 同步失败 : ERROR: Expected ':' at line 1 column 11 path $. 请,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60071292/

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