gpt4 book ai didi

android - 我在gradle中使用firebase-ui时不会获得firebase token

转载 作者:行者123 更新时间:2023-12-03 06:30:45 24 4
gpt4 key购买 nike

我正在使用以下命令从firebase获取 token :

FirebaseInstanceId.getInstance().getToken();

一切正常,但是当我在gradle中使用以下命令时,出现错误:
compile 'com.firebaseui:firebase-ui:0.6.2'

我的日志是:
Process: ir.bitafaraz.dpnaadmin, PID: 17325
java.lang.NoSuchMethodError: com.google.android.gms.common.util.zzx.getNoBackupFilesDir
at com.google.firebase.iid.zzg.zzeC(Unknown Source)
at com.google.firebase.iid.zzg.<init>(Unknown Source)
at com.google.firebase.iid.zzg.<init>(Unknown Source)
at com.google.firebase.iid.zzd.zzb(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
at ir.bitafaraz.dpnaadmin.LoginActivity.onClick(LoginActivity.java:250)
at android.view.View.performClick(View.java:4457)
at com.balysv.materialripple.MaterialRippleLayout$PerformClickEvent.run(MaterialRippleLayout.java:648)
at com.balysv.materialripple.MaterialRippleLayout$3.onAnimationEnd(MaterialRippleLayout.java:336)
at android.animation.AnimatorSet$AnimatorSetListener.onAnimationEnd(AnimatorSet.java:818)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1078)
at android.animation.ValueAnimator.access$400(ValueAnimator.java:53)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:649)
at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:665)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:768)
at android.view.Choreographer.doCallbacks(Choreographer.java:581)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:754)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:895)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:711)
at dalvik.system.NativeStart.main(Native Method)

我的成绩是:
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"

defaultConfig {
applicationId "ir.bitafaraz.dpnaadmin"
minSdkVersion 17
targetSdkVersion 25
versionCode 16
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:animated-vector-drawable:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:palette-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:customtabs:25.3.1'

compile 'com.balysv:material-ripple:1.0.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1@aar'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.firebaseui:firebase-ui:0.6.2'
}

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

最佳答案

我将版本Firebase更改为1.1.1,并将Firebase消息传递更改为10.0.1:

compile 'com.firebaseui:firebase-ui:1.1.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'

然后将此命令添加到 Manifest.xml的应用程序标签中:
tools:replace="android:supportsRtl"

并将以下命令添加到gradle中:
allprojects {
repositories {
jcenter()

// Required for 'com.firebaseui:firebase-ui:1.1.1'
maven {
url 'https://maven.fabric.io/public'
}
}
}

关于android - 我在gradle中使用firebase-ui时不会获得firebase token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44352784/

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