AppCenter build error: Project firebaseauth_web at : is either no Android app project or build version has not been set to override - firebase

I have a mobile project in flutter and I am trying to build it on AppCenter but I got this error:
Project firebaseauth_web at : is either no Android app project or build version has not been set to override. Skipping...
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/runner/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.3+1/android/build.gradle' line: 22
* What went wrong:
A problem occurred evaluating root project 'firebaseauth_web'.
> Failed to apply plugin [id 'com.android.library']
> Minimum supported Gradle version is 5.4.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in /Users/runner/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.3+1/android/gradle/wrapper/gradle-wrapper.properties to gradle-5.4.1-all.zip
* 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 4s
The plugin firebase_auth_web could not be built due to the issue above.
##[error]The process '/bin/bash' failed with exit code 1
##[error]Bash failed with error: The process '/bin/bash' failed with exit code 1
##[section]Finishing: Post Clone Script
##[section]Starting: Checkout Chofu#master to s
==============================================================================
Task : Get sources
Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version : 1.0.0
Author : Microsoft
Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: Chofu (ExternalGit)
##[section]Finishing: Checkout Chofu#master to s
##[section]Starting: Finalize Job
Cleaning up task ***
Start cleaning up orphan processes.
Terminate orphan process: pid (1490) (java)
Terminate orphan process: pid (1470) (java)
Terminate orphan process: pid (1462) (java)
Terminate orphan process: pid (1404) (java)
Terminate orphan process: pid (1289) (adb)
##[section]Finishing: Finalize Job
##[section]Finishing: Build
My gradle version is actually 6.1.1.
Here is my gradle-wrapper.properties from android/gradle code:
...
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
...
I have tried to change the version to 5.4.1 but I got a similar error:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/runner/runners/2.170.1/work/1/s/android/app/build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.internal.version-check']
> Minimum supported Gradle version is 6.1.1. Current version is 5.4.1. If using the gradle wrapper, try editing the distributionUrl in /Users/runner/runners/2.170.1/work/1/s/android/gradle/wrapper/gradle-wrapper.properties to gradle-6.1.1-all.zip
* 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 18s
Running Gradle task 'assembleRelease'... 19.8s
Gradle task assembleRelease failed with exit code 1
EDITED:
After a better look I discover other 2 errors:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':appcenter:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':appcenter_analytics:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
If someone could help me I would be grateful!

After one month of struggle I found how to solve the problem:
I have changed gradle version from android/gradle/wrapper/gradle-wrapper.properties from 6.1.1 to 5.6.2 . So my file looks like:
...
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
...
In android/build.gradle I have changed gradle tool version from 4.0.0 to 3.5.0:
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
...
}
In android/app/build.gradle I have added checkReleaseBuilds false to lintOptions :
lintOptions {
...
checkReleaseBuilds false
}
In android/app/appcenter-post-clone.sh I have added two builds before --release build:
...
# build APK
flutter build apk --debug
flutter build apk --profile
flutter build apk --release
...
I hope this will help others :)

Related

Unable to build apk after adding firebase-analytics[Ionic, Cordova]

I am getting error when I try to build apk after adding firebase-analytics. It is showing error in console is
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\sampleproject\platforms\android\app\build.gradle' line: 428
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.google.gms.google-services']
> Cannot add extension with name 'googleServices', as there is an extension already registered with that name.
* 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 6s
Command failed with exit code 1: D:\sampleproject\platforms\android\gradlew cdvBuildDebug -b D:\sampleproject\platforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
The file googleservices is already present in my project before. As I am using Firebase authentication before in my project. Now the issue is, I can't edit the Gradle file as I am using Cordova to build the Apk.
I also gone through other stackoverflow question and answers, I commented out
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
in gradle but this is not the proper way to solve this problem.
Below this I am mentioning all the extensions I had in my project.
"#ionic-native/firebase-analytics": "^5.36.0",
"#ionic-native/google-plus": "^5.28.0",
"firebase": "^7.19.1",
"google-auth-library": "^6.0.6",
"cordova-plugin-firebase-analytics": "^6.1.0",
"cordova-plugin-firebase-lib": "^5.1.1",
For more clarification I attached the screenshot.
Thank you in advance.

my firebase version is not support with my onesignal plugin version I a lot of way to config this but the problem is still exist

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.

Flutter Gradle task assembleRelease failed with exit code 1 while build apk

PS C:\flutter projeleri\firebase> flutter build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
Parameter format not correct -
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.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not delete old C:\flutter projeleri\firebase\build\app\reports\lint-results-release-fatal.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
BU�LD FAILED in 10m 37s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 641,3s (!)
Gradle task assembleRelease failed with exit code 1
what's the problem?
first delete your build folder and use this command in terminal
flutter build apk --split-per-abi

Using physical device to run simple firebase flutter app and getting gradle errors

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'

Execution failed for task ':firebase_auth:compileDebugJavaWithJavac'

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

Resources