Can't integrate Firebase with my application - firebase

When I integrate Firebase with my app, Build failed with an exception.
Although the first error that occurred was a gradle update, i've tried and i still get an error while running gradle.
Because there was no error in the code and the amount of coding was too much, I can only show error messages.
Error running Gradle:
ProcessException: Process "C:\Users\82109\AndroidStudioProjects\instargram_clon\android\gradlew.bat" exited abnormally:
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Configure project :app
WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
*********************************************************
WARNING: This version of image_picker will break your Android build if it or its dependencies aren't compatible with AndroidX.
See goo.gl/CP92wY for more information on the problem and how to fix it.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
Command: C:\Users\82109\AndroidStudioProjects\instargram_clon\android\gradlew.bat app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
※ When integrating Firebase with my app, I'm wondering if several versions are all up-to-date. This is because i have optionally and randomly changed to the latest version.

for firebase you can integrate your app manually see firebase documentation
for a quick answer follow this steps:android
Create a Firebase project
Register your app with Firebase
Add a Firebase configuration file (google-services.json)
Add Firebase SDKs to your app
WARNING: This version of image_picker will break your Android build if it or its dependencies aren't compatible with AndroidX => update your image_picker

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>

Flutter trying to installing packages

No matter which package I tried to install when running on iOS simulator get an error the same no matter which package.
fatal error: module 'name of the module I'm trying' not found
Is a new MacBook Air, so I can't emulate Android to see if is the same.
Been days stuck here
This is the output:
Failed to build iOS app Error output from Xcode build: ↳
objc[94975]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1faf938f0) and ?? (0x11acac2b8). One of the two will be
used. Which one is undefined.
objc[94975]: Class AMSupportURLSession is implemented in both ?? (0x1faf93940) and ?? (0x11acac308). One of the two will be used. Which
one is undefined.
** BUILD FAILED **
Xcode's output: ↳
/Users/rafy/Desktop/Flutter_App_with_Android_Studio/cte_baberia/ios/Runner/GeneratedPluginRegistrant.m:10:9:
fatal error: module 'firebase_auth' not found
#import firebase_auth;
~~~~~~~^~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To
resolve this, select a development team in the Runner editor. (in
target 'Runner' from project 'Runner')
Could not build the application for the simulator. Error launching
application on iPhone 12 Pro Max.
Please run a flutter clean and then post the outputs when you run these commands:
pub get
and
flutter build ios

You attempted to use a firebase module that's not installed on your Android project by calling firebase.config()

i am getting the following error in android after adding notifications to the app.
Error: You attempted to use a firebase module that's not installed on your Android project by calling firebase.config().
Ensure you have:
1) Installed the required Firebase Android SDK dependency 'com.google.firebase:firebase-config' in your 'android/app/build.gradle' file.
2) Imported the 'io.invertase.firebase.config.RNFirebaseRemoteConfigPackage' module in your 'MainApplication.java' file.
3) Added the 'new RNFirebaseRemoteConfigPackage()' line inside of the RN 'getPackages()' method list.
when i do all the recommended things (com.google.firebase:firebase-notifications:16.0.0) i am getting
that the firebase-notifications:16.0.0 is not found error while running

Cause: org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl

I have connected my Android application with firebase-database by putting this dependency (kapt 'com.google.firebase:firebase-database:16.0.1:15.0.0') but after that I am getting errors like the one mentioned in title also when I synchronized the project I am getting different errors like: Connection time out, Failed to resolved build listener.
Enabling/Disabling offline work and setting proxy in gradle.properties file doesn't work for me.
Also you guys have seen that I used 'kapt' in dependency as it is necessary to use, without it I am getting error "failed to resolve 15.0.0". Removing 15.0.0 doesn't work for me.
Error
Cause:org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifier;ing
I am using Android Studio 3.2 and sadly I can't update this version.
Gradle version: 5.1.1 and
Plugin version: 3.4.0

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