Can not Resolved FirebaseOptions.Builder().setCredentials() i have referred to answers in this link but it did not solve my problem. here's my code:
FileInputStream serviceAccount =
new FileInputStream("./ServiceAccountKey.json");
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("https://imiocr-f4522.firebaseio.com")
.build();
FirebaseApp.initializeApp(options);
FirebaseApp.initializeApp(options);
String customToken = FirebaseAuth.getInstance().createCustomTokenAsync("3mLImCwhyddkVZ9PWWNlw34pFVR2").get();
this is my app gradle file dependencies:
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
implementation 'com.wang.avi:library:2.1.3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.firebaseui:firebase-ui-database:4.2.0'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation 'com.android.support:design:28.0.0-alpha1'
//implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.firebaseui:firebase-ui-storage:4.1.0'
//implementation 'com.google.firebase:firebase-admin:6.2.0'
setCredentials method is never recognized, please help.