我正在尝试将图像上传到Firebase存储。它以前可以正常工作,但是由于某种原因停止运行,并不断出现相同的错误。
E/StorageUtil: error getting token java.util.concurrent.ExecutionException: com.google.firebase.internal.api.FirebaseNoSignedInUserException: Please sign in before trying to get a token.
D/ViewRootImpl@7a79a7a[Uploading]: dispatchAttachedToWindow
W/NetworkRequest: no auth token for request
我尝试重新下载并放置google json文件,卸载并重新安装该应用程序,而我的firebase规则是公开的,但无济于事
请帮助!
渐变依赖项
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.example.finalwallpaperapp"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.material:material:1.1.0-alpha09'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-database:18.0.1'
implementation 'com.google.android.gms:play-services-tasks:17.0.0'
implementation 'com.google.firebase:firebase-storage:18.1.1'
implementation 'com.google.firebase:firebase-auth:18.1.0'
implementation 'com.firebase:firebase-client-android:2.4.0'
implementation group: 'com.firebase', name: 'firebase-client-jvm', version: '2.5.2'
testImplementation 'junit:junit:4.12'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview-selection:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'co.gofynd.library:gravity-view:1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
}
存储规则
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}