Firebase ML Kit - firebase

Trying to use Firebase ml kit for label but getting error below with version; firebase_ml_vision: ^0.9.10
Error
Launching lib\main.dart on sdk gphone x86 arm in debug mode...
lib\main.dart
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[19.0.
2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.android.gms:play-services-vision:20.0.0 -> com.google.android.gms:play-services-vision-co
mmon#[19.0.2], but play-services-vision-common version was 19.1.0.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto com.google.firebase:firebase-ml-vision#{strictly 24.1.0}
-- Project 'app' depends on project 'firebase_ml_vision' which depends onto com.google.firebase:firebase-ml-vision#20.0.
0
-- Project 'app' depends onto com.google.android.gms:play-services-vision-common#{strictly 19.1.0}
-- Project 'app' depends onto com.google.firebase:firebase-bom#26.2.0
-- Project 'app' depends onto com.google.android.gms:play-services-vision-image-label#{strictly 18.0.4}
-- Project 'app' depends onto com.google.firebase:firebase-bom#{strictly 26.2.0}
-- Project 'app' depends onto com.google.android.gms:play-services-vision#{strictly 20.0.0}
For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = true }" to your bu
ild.gradle file.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BU�LD FAILED in 13s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
After searching on github, somehow with edit below, app is running now, but when i try to use mlkit, getting error below
Edit 2
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:26.0.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.android.support:multidex:1.0.3'
api 'com.google.firebase:firebase-ml-vision-face-model:20.0.2'
implementation 'com.google.android.gms:play-services-vision:20.1.1'
implementation 'com.google.android.gms:play-services-vision-common:19.1.1'
implementation 'com.google.android.gms:play-services-vision-image-label:18.0.5'
implementation 'com.google.android.gms:play-services-vision-face-contour-internal:16.0.2'
}
Error in App
D/MediaScannerConnection( 8393): Scanned /storage/emulated/0/Android/data/com.example.temp_name/files/Pictures/e235923b-70f9-404a-aa0b-930333cceea96952909717190624838.jpg to null
I/flutter ( 8393): /storage/emulated/0/Android/data/com.example.temp_name/files/Pictures/scaled_e235923b-70f9-404a-aa0b-930333cceea96952909717190624838.jpg
W/DynamiteModule( 8393): Local module descriptor class for com.google.android.gms.vision.dynamite.ica not found.
I/DynamiteModule( 8393): Considering local module com.google.android.gms.vision.dynamite.ica:0 and remote module com.google.android.gms.vision.dynamite.ica:0
W/DynamiteModule( 8393): Local module descriptor class for com.google.android.gms.vision.ica not found.
I/DynamiteModule( 8393): Considering local module com.google.android.gms.vision.ica:0 and remote module com.google.android.gms.vision.ica:0
E/Vision ( 8393): Error loading optional module com.google.android.gms.vision.ica: com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0.
W/LabelerNativeHandle( 8393): Native handle not yet available. Reverting to no-op handle.

Since you're including firebase-bom:26.2.0, that determines the versions of all Firebase SDKs you use. So remove the version numbers from all other Firebase SDK dependencies in your build.gradle to get rid of the version conflict.

Related

Flutter:The plugin firebase_auth could not be built due to the issue above

I just use firebase_auth package to send me code by phone Number. it work fine in debug mode but when I try to get apk it show me this error. can anyone help me please?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sms:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\Mohammad Asef\.gradle\caches\transforms-2\files-2.1\8014592fef965c457f4d96ed4583a915\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\Mohammad Asef\.gradle\caches\transforms-2\files-2.1\8014592fef965c457f4d96ed4583a915\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3m 52s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 233.5s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the
incompatibility.
Building plugin firebase_auth...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 0.3s
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.zip.ZipFile.<init>(ZipFile.java:169)
at org.gradle.wrapper.Install.unzip(Install.java:214)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:74)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
The plugin firebase_auth could not be built due to the issue above.
firebase_auth is using AndroidX libraries, but your flutter project is still using the old android support library. To solve this upgrade to flutter latest version. From the docs:
How do I know if my project is using AndroidX?
Starting from Flutter v1.12.13, new projects created with flutter create -t <project-type> use AndroidX by default.
Projects created prior to this Flutter version must not depend on any old build artifact or old Support Library class.
In an app or module project, the file android/gradle.properties or .android/gradle.properties must contain:
android.useAndroidX=true
android.enableJetifier=true
https://flutter.dev/docs/development/androidx-migration
I solved it by adding firebase_analytics dependency in pubspec, then adding manually string value of default_notification_channel_id in android resource just like below
<string name="default_notification_channel_id" translatable="false">fcm_default_channel</string>

after installing image crop picker and debug problem

my all project is working fine but when i install image crop picker dependency then it shows the error even there is no build.
FAILURE: Build failed with an exception. Error given below
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
F:\bgbyteappfolder\newbgb\node_modules\react-native-image-crop-picker\android\build\intermediates\library_manifest\debug\AndroidManifest.xml:10:5-14:15: AAPT: error: unexpected element found in .
BUILD FAILED in 31s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: Some input files use or override a deprecated API..
i Am expecting rapid action on this failure stackoverflow family
Upgrade your gradle version by adding classpath 'com.android.tools.build:gradle:4.0.1' in your android/build.gradle file:
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
}
}
After this clean your build folder by:
cd android
./gradlew clean

Flutter: error when trying to run app with new firebase dependencies

I created a simple app with flutter, and I'm now trying to connect it to an online database, namely googles Firebase. I have added the essentials to my build.gradle files:
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
}
and
apply plugin: 'com.google.gms.google-services'
I've also added the google-services.json file to the android/app path, but only after I've added one of their packages to my pubspec.yaml file, namely cloud_firestore: tabbed under dependencies: I got this error when I tried to run the app (when I ran it without only that package it worked):
'''
Note: /Users/pepijnvanderklei/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.13.5/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
D8: Cannot fit requested classes in a single dex file (# methods: 75778 > 65536)
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1m 50s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 111,8s
Exception: Gradle task assembleDebug failed with exit code 1
'''
Does anyone know what going wrong?
When using firebase, you need to update the minSdkVersion inside android/app/build.gradle to version 21:
minSdkVersion 21
By default, Flutter supports Android SDK v16 (Jelly Bean, released 2012), but multidex doesn't really work with Jelly Bean (though, it's possible). Configuring Jelly Bean to work is beyond the scope of this codelab, so we'll change the minimum target SDK version from v16 to v21 (Lollipop, released 2014).
https://codelabs.developers.google.com/codelabs/flutter-firebase/#3

Could not determine the dependencies of task ':app:preDebugBuild'

I am build an app with firebase dependencies before creating an app i have done the firebase configuration and added firebase dependencies in pubspec.yaml. But when i run the app i got some errors.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.
1]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.android.gms:play-services-flags:15.0.1 -> com.google.android.gms:play-services-basement#[
15.0.1], but play-services-basement version was 16.0.1.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends on project 'firebase_auth' which depends onto com.google.firebase:firebase-auth#16.0.2
-- Project 'app' depends on project 'firebase_core' which depends onto com.google.firebase:firebase-core#16.0.4
-- Project 'app' depends on project 'firebase_database' which depends onto com.google.firebase:firebase-database#15.+
For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
Finished with error: Gradle task assembleDebug failed with exit code 1
The Problem occur when the dependencies cannot download from jcenter server. change your network connection follows flutter clean and try again
you can still work in debug mode
flutter run --debug will work
or you can goto File > Settings>Build,Execution,Deployment>Build Tools>Gradle>Uncheck Offline work option in Android Studio
You can also invalidate Cache and Restart

Ionic blank project's build failed after adding mfp-push plugin

create an blank ionic project and added mfp and mfp-push plugins. Tried to build and got this error:
BUILD FAILED in 41s
Error: cmd: Command failed with exit code 1 Error output:
C:\Users\saikmeda\TestFbSdk\platforms\android\app\src\main\java\com\ibm\mobilefirstplatform\clientsdk\cordovaplugins\push\CDVMFPPush.java:100: error: cannot access FirebaseInstanceIdService
MFPPush.getInstance().initialize(this.cordova.getActivity().getApplicationContext(), timeout);
^
class file for com.google.firebase.iid.FirebaseInstanceIdService not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 41s
The latest MFP 8.0 client side iFix for Android has been modified to work with FCM completely. The error message you see is coming because there are some changes needed in your Android project - specifically around removing GCM classes and modifying for FCM.
Follow the instructions in the link to get your project working:
http://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/notifications/handling-push-notifications/android/#migrate-to-fcm
Now, all this is required only if you use MFP's push feature. If you do not , you can remove cordova-plugin-mfp-push plugin from your project and rebuild it.

Resources