Firebase Authenticationを使用したアプリを作成しているのですが下記のメソッドで
「Cannot resolve method」エラーが発生しまして、解決方法がわからないため教えていただきたいです。
com.google.firebase.auth.FirebaseAuth#createUserWithEmailAndPassword() com.google.firebase.auth.FirebaseAuth#signInWithEmailAndPassword() com.google.firebase.auth.FirebaseAuth#signOut()
以前は上記3つのメソッドが使用できており、アプリで正常に機能が使用できていました。
しかし、下記のbuild.gradle(app)のバージョンNo.を変更(例えば、firebase-messagingのバージョンを16.0.4→19.2.0 に変更など)しているうちに使用できなくなってしまいました。
AndroidStudioをアンインストールし、関連ファイル(/.gradle以下の外部ライブラリなど)を削除してみましたが解決されませんでした。調べても解決方法が出てこなかったため教えていただきたいです。
build.gradle(app)↓
apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 28 defaultConfig { applicationId "com.example.masaki.lineapp" minSdkVersion 16 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/io.netty.versions.properties' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/license.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/notice.txt' exclude 'META-INF/ASL2.0' exclude 'META-INF/INDEX.LIST' } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.google.firebase:firebase-auth:16.0.5' implementation 'com.google.firebase:firebase-database:19.2.0' implementation 'com.google.firebase:firebase-messaging:20.1.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'com.google.firebase:firebase-admin:6.8.1' annotationProcessor 'com.google.auto.value:auto-value:1.4' }
Android Studio 3.5.3 Build #AI-191.8026.42.35.6010548, built on November 15, 2019 JRE: 1.8.0_202-release-1483-b49-5587405 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.14.6
1/2 2:14 更新
上記3つのメソッドについて、「com.google.firebase:firebase-auth:16.0.5」ではなく、「implementation 'com.google.firebase:firebase-admin:6.8.1」のjarのものを使用している(バッティング・競合している)ことがわかりました。(同じクラスを含むjarファイルが混在 している)
試しに、firebase-adminの方をbuild.gradleから削除してみたところ、firebase-authの方が使用され、cannot resolve methodエラーが消えました。
しかし、firebase-adminは他の箇所で使用する必要があり、どうしても残しておく必要があるため、上記3つのメソッドについて、firebase-authの方のjarを使用するように設定する方法がありましたら教えていただきたいです。
あなたの回答
tips
プレビュー