why my app can’t use FirebaseVisionLabelDetectorOptions class - android

I tried to make an object from FirebaseVisionLabelDetectorOptions class but my app doesn’t import it
I got this error . And this is my dependencies
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-database:19.3.0'
implementation 'com.wonderkiln:camerakit:0.13.1'
implementation 'com.github.d-max:spots-dialog:1.1#aar'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.firebase:firebase-ml-vision:24.0.3'

You are using the Cloud Landmarks API so you will need the Cloud Options class
FirebaseVisionCloudDetectorOptions options =
new FirebaseVisionCloudDetectorOptions.Builder()
.setModelType(FirebaseVisionCloudDetectorOptions.LATEST_MODEL)
.setMaxResults(15)
.build();
The Cloud based APIs work differently to on-device ones, so the options will be slightly different.

Related

How to fix Vulnerable WebRTC version error by third party libraries?

My Application in play developer console is showing error "Vulnerable WebRTC Versions, Your app uses a bad version of WebRTC, which contains security vulnerabilities."
I am using twilio video SDK, however it seems to be the latest version. Still cant figure out which library is using webrtc.
implementation platform('com.google.firebase:firebase-bom:31.1.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.dagger:dagger-android-support:2.38'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.jakewharton:butterknife:10.2.3'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
debugImplementation "com.github.chuckerteam.chucker:library:3.5.2"
releaseImplementation "com.github.chuckerteam.chucker:library-no-op:3.5.2"
implementation 'com.squareup.picasso:picasso:2.71828'
implementation "androidx.lifecycle:lifecycle-runtime:2.5.1"
implementation "androidx.lifecycle:lifecycle-common-java8:2.5.1"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:core:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test:runner:1.5.1'
androidTestImplementation "androidx.test:rules:1.5.0"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.38'
annotationProcessor 'com.google.dagger:dagger-compiler:2.38'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation "com.google.android.material:material:1.8.0-beta01"
//nav components
implementation 'androidx.navigation:navigation-fragment:2.5.3'
implementation 'androidx.navigation:navigation-ui:2.5.3'
implementation 'com.github.aabhasr1:OtpView:v1.1.2'
implementation 'com.pusher:pusher-java-client:2.2.6'
implementation 'androidx.room:room-runtime:2.4.3'
annotationProcessor 'androidx.room:room-compiler:2.4.3'
implementation 'com.squareup:otto:1.3.8'
implementation 'com.twilio:video-android:7.5.1'
implementation "com.twilio:audioswitch:1.1.2"
implementation 'androidx.core:core-splashscreen:1.0.0'
implementation "androidx.coordinatorlayout:coordinatorlayout:1.2.0"
//progress bar
implementation 'com.github.uzairiqbal91:CircularTimerView:1.0'
implementation "androidx.work:work-runtime:2.7.1"
//country code picker
implementation 'com.hbb20:ccp:2.6.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'io.github.informramiz:nameinitialscircleimageview:1.6'
implementation 'com.github.Drjacky:ImagePicker:2.1.16'
//App update
implementation 'com.google.android.play:app-update:2.0.1'
//Live
implementation 'com.github.florent37:singledateandtimepicker:2.2.7'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
Is there a way to find which of these libraries use webrtc and what versions?

Duplicate class when adding Firebase-ML to Gradle

I am totally new to android studio. I am trying to read some text using Firebase-ML, but I am getting duplicate class error when I try to run the program
Error:
Duplicate class com.google.android.gms.internal.vision.zzu found in modules jetified-play-services-vision-common-19.1.3-runtime (com.google.android.gms:play-services-vision-common:19.1.3) and jetified-play-services-vision-image-labeling-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-image-labeling-internal:16.0.0)
Here are my Gradle dependencies.
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation platform('com.google.firebase:firebase-bom:26.3.0')
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.firebase:firebase-ml-vision:24.1.0'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:20.0.2'
implementation 'com.google.android.material:material:1.2.1'
}
I don't know what to do here?
I think this might be the same I ran into when adding another Google API. Try adding the following to your build.gradle:
android {
.
.
.
// Firebase uses a smaller proto but other Google APIs uses the full system so I need to exclude the
// light libraries when using Google APIs with Firebase and then Firebase will use the
// full library
configurations {
implementation.exclude module: 'protobuf-lite'
}

Google play services ads SDK is too big that causing over 64K methods

I am using com.google.android.gms:play-services-ads:19.5.0
is there any way to use this google play dependency and can run into the 64K reference limit?
I have used that dependency before and i have never got multidex errors(# methods: 66043 > 65536) but why on this app in which i have lesser dependencies than other apps.
App1: This app is with over 64K methods
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.android.material:material:1.2.0-alpha02'
implementation 'com.google.android.gms:play-services-ads:19.5.0'
}
App2: But this app work fine with same google play service dependency
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.android.gms:play-services-ads:19.5.0'
}
Any ideas?
There is a lite version of the ads dependency that is much smaller than the full version and can help you stay under the 64K limit:
implementation 'com.google.android.gms:play-services-ads-lite:19.5.0'
You can find more information about it here: https://developers.google.com/admob/android/lite-sdk

How to use Cotter as an alternative for Firebase to verify phone?

I want to use Cotter as an alternative for Firebase to verify phone.
I followed the steps on:
Cotter page: Verifying email and phone number in your mobile app using our Android SDK
But I get this error when trying to sync the gradle:
Failed to resolve: com.github.cotterapp:android-sdk:0.3.0
Code is:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.preference:preference:1.1.1'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.android.material:material:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.navigation:navigation-fragment:2.3.0'
implementation 'androidx.navigation:navigation-ui:2.3.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
//Cotter
implementation 'com.github.cotterapp:android-sdk:0.3.0'
}
And I also want to know how to do this:
For step 2 I need to Initialize Cotter with your API_KEY_ID. Using this code:
Cotter.init(this.getApplicationContext(),
"https://www.cotter.app/api/v0",
<API_KEY_ID>);
Where must I put this code?

Cannot Resolve setCredentials in FirebaseOptions.Builder().setCredentials(...)

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.
You seem to be trying to use both the Admin SDK and the regular Android SDK for Firebase in the same app. This is not a supported scenario.
The Admin SDK is specifically meant for use on servers, and other trusted environments. Using in Android apps that you share with your users opens your Firebase project up to abuse.
If you need some functionality in your app that is not available in the Android SDK, but is possible through the Admin SDK, consider wrapping that functionality in Cloud Functions, and calling that from your Android app. That way you can control what specific functionality you make available, instead of giving them full access to your Firebase project.

Categories

Resources