I have connected my app to firebase and then I did steps for phone authentication but now when I run my app in release mode it doesn't run and shows error below-:
Running "flutter pub get" in tax... 0.7s
Launching lib\main.dart on Redmi Note 7 Pro in release mode...
Note: C:\Src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.7.0\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.
java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Src\flutter\.pub-cache\hosted\pub.dartlang.org\geolocator-5.3.2+2\android\src\main\java\com\baseflow\geolocator\tasks\LocationUpdatesUsingLocationMa
nagerTask.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
> Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: C:\Users\PALAK\AndroidStudioProjects\tax\build\app\intermediates\flutter\debug\libs.jar.
> Transform's input file does not exist: C:\Users\PALAK\AndroidStudioProjects\tax\build\app\intermediates\flutter\debug\libs.jar. (See https://i
ssuetracker.google.com/issues/158753935)
* 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 8s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 69.7s
Exception: Gradle task assembleRelease failed with exit code 1
i have no idea why this is happening can anyone guide me please?
Replace "bin" with "all" in
Project/android/gradle/wrapper/gradle-wrapper.properties I mean change
6.5-bin.zip to 6.5-all.zip
Then do flutter clean and try.
did you provide the internet permission in manifest like this ?
<uses-permission android:name="android.permission.INTERNET" />
Related
Launching lib\main.dart on Pixel 3 XL in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not resolve com.google.firebase:firebase-messaging:[10.2.1, 17.3.99].
Required by:
project :app > com.onesignal:OneSignal:3.15.3
> Skipped due to earlier error
Could not resolve com.google.android.gms:play-services-ads-identifier:[15.0.0, 16.0.99].
Required by:
project :app > com.onesignal:OneSignal:3.15.3
> Skipped due to earlier error
Could not resolve com.google.android.gms:play-services-base:[10.2.1, 16.1.99].
Required by:
project :app > com.onesignal:OneSignal:3.15.3
> Skipped due to earlier error
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 2m 24s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 145.7s (!)
Try Going to File > Invalidate Caches/Restart and see if it works for you.
it is working fine on iOS but facing this issue on android
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':firebase_auth:generateDebugRFile'.
Could not resolve all files for configuration ':firebase_auth:debugCompileClasspath'.
Could not find com.facebook.android:facebook-login:[8.1).
Required by:
project :firebase_auth
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 20s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
The version given by the facebook documentation doesn't work for me either.
That's the version i am actually using:
implementation 'com.facebook.android:facebook-login:[8,9)'
Anyway, if it doesn't solve your problem, try to give more information like, the plugin you are using for the facebook authentication, its version, and the firebase_auth and firebase_core version of the plugin you are using
It just worked with me when i switched to windows (don't know how ) and the error still show on Mac OS after trying all available solutions
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>
Launching lib\main.dart on Redmi 5 Plus in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "C:\user\proj\android\gradlew.bat" exited
abnormally:
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be
reused, use --status for details
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\user\proj\android\app\build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
ASCII
* 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 22s
Command: C:\user\proj\android\gradlew.bat app:properties
Finished with error: Please review your Gradle project setup in the android/
folder.
But if I comment apply plugin: 'com.google.gms.google-services' in proj/app/build.gradle it will work perfectly but than firebase is not working.
I hope you write this all dependencies in your file
like
CHECK My Github file
Have you added the google-services.json at the right location? (with app-level build.gradle)
Also, check if you have these as dependency in project level build.gradle
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
After upgrading firebase_auth from earlier version to ^0.8.0+1 generates error for me.
Here is error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':firebase_auth: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. 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
According to the Changelog, you have to perform a migration in the Android project to AndroidX.
The details of the changes required are here.
See CHANGELOG:
0.8.0
Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.
Firstly set the compileSdkVersion to 28 in the android/app/build.gradle file.
Secondly add the following to your android/gradle.properties file:
android.useAndroidX=true
android.enableJetifier=true