gpt4 book ai didi

java - 错误 Gradle 同步失败 : For input string: "12" when apply plugin: 'com.google.gms.google-services'

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

我按照谷歌文档将我的应用程序集成到谷歌分析。但是在添加模块时:app build.gradle

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

在构建我的应用程序时,我遇到了此错误:

Gradle sync failed: For input string: " 12"

我的项目build.gradle是:

plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.android.application'
apply plugin: 'io.objectbox'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'io.fabric'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId 'xxx.xxxx.xxxxx'
minSdkVersion 19
targetSdkVersion 25
versionCode 74
versionName "1.0.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "xxxxx-xxxxxx-xxx",
onesignal_google_project_number: "REMOTE"]

javaCompileOptions {
annotationProcessorOptions {
arguments = ['objectbox.debug': 'true']
}
}
}
dataBinding {
enabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'

implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'

implementation 'com.facebook.android:facebook-login:[4,5)'
compile 'com.facebook.android:facebook-share:[4,5)'
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.android.support:design:27.1.1'
implementation 'com.orhanobut:logger:2.2.0'
compile 'joda-time:joda-time:2.9.9'
compile('com.afollestad:bridge:5.1.2') {
exclude group: 'org.json', module: 'json'
}
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
compile 'jp.wasabeef:blurry:2.1.1'
compile 'com.makeramen:roundedimageview:2.3.0'
compile('com.redmadrobot:inputmask:2.3.0') {
exclude group: 'org.jetbrains', module: 'annotations'
}
compile 'se.emilsjolander:stickylistheaders:2.7.0'
compile 'com.daimajia.easing:library:2.0@aar'
compile 'com.daimajia.androidanimations:library:2.3@aar'
compile 'com.github.javadev:underscore:1.29'
compile 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
compile 'com.mixpanel.android:mixpanel-android:5.+'
compile 'com.github.thomper:sweet-alert-dialog:v1.4.0'
compile 'com.github.faranjit:currency-edittext:1.0.1'
compile 'org.apache.commons:commons-lang3:3.7'
compile 'com.google.guava:guava:24.1-android'
compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
transitive = true
}
compile('com.github.worker8:tourguide:1.0.19-SNAPSHOT@aar') {
transitive = true
}
}

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

应用程序 build.gradle 是:

buildscript {
ext.objectboxVersion = '1.5.0'
repositories {
jcenter()
google()
mavenCentral()
maven { url "http://objectbox.net/beta-repo/" }
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
maven { url "https://raw.githubusercontent.com/smilefam/SendBird-SDK-Android/master/" }
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.google.gms:google-services:3.3.1'
}
}

allprojects {
repositories {
jcenter()
google()
mavenCentral()
maven { url "http://objectbox.net/beta-repo/" }
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
maven { url "https://raw.githubusercontent.com/smilefam/SendBird-SDK-Android/master/" }
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
}

task clean(type: Delete) {

delete rootProject.buildDir
}

如果我删除应用

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

,构建正常工作。但 Firebase 无法正确启动。

最佳答案

减少 Google 服务的版本号。我在使用时遇到类似的 gradle 同步错误

com.google.gms:google-services:3.3.0

所以我改为

com.google.gms:google-services:3.2.1

并且成功了。

关于java - 错误 Gradle 同步失败 : For input string: "12" when apply plugin: 'com.google.gms.google-services' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50466913/

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