Ionic Capacitor FCM , android build failing - android

I am stuck at the below issue for quite some time and its not getting resolved, had searched across stack overflow, google, but nothing is working for me. There's a workaround suggested on ionic portal, that too is not working. Please help me to resolve the issue.
I have tried to add google-services.json in android/app directory, then the 2nd issue comes, then why I tried to add the same file android/capacitor-cordova-android-plugins directory, then another issue comes stating:
Execution failed for task ':capacitor-cordova-android-plugins:processDebugGoogleServices'. No matching client found for package name 'capacitor.android.plugins'
Below is the original issue, when google-services.json, is not placed anywhere.
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/Users/xxxx/development/projects/appName/android/app/google-services.json
/Users/xxxx/development/projects/appName/android/app/src/nullnull/google-services.json
/Users/xxxx/development/projects/appName/android/app/src/debug/google-services.json
/Users/xxxx/development/projects/appName/android/app/src/nullnullDebug/google-services.json
/Users/xxxx/development/projects/appName/android/app/src/nullnull/debug/google-services.json
/Users/xxxx/development/projects/appName/android/app/src/debug/nullnull/google-services.json
* 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 ':capacitor-cordova-android-plugins:processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/google-services.json
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/src/nullnull/google-services.json
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/src/debug/google-services.json
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/src/nullnullDebug/google-services.json
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/src/nullnull/debug/google-services.json
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/src/debug/nullnull/google-services.json
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s
118 actionable tasks: 22 executed, 96 up-to-date

Related

How to resolve Gradle task assembleDebug failed with exit code 1 in my first flutter app?

I recently come from java and try to make my first app in flutter in android studio in windows 10.
I tried first sample code in my real android device and got this error.
I cant find proper after struggling 5 hours
In console get this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> NDK at C:\Users\10\AppData\Local\Android\sdk\ndk-bundle did not have a source.properties 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 1s
Exception: Gradle task assembleDebug failed with exit code 1
Looks like you are missing NDK installation. Please confirm if highlighted item is installed

Codemagic flutter failed to build android

Whenever I run it it get stuck in android. This happened to me locally and I solve it doing flutter clean, which I don't know how to do in codemagic. The problem is that is nos building, heres the log.
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> java.net.URISyntaxException: Illegal character in opaque part at index 2: C:\\Users\\thech\\Downloads\\nueva_temporada-20210514T040146Z-001\\nueva_temporada\\build\\app\\intermediates\\flutter\\debug\\flutter_assets\\AssetManifest.json
* 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 30s
Running Gradle task 'assembleDebug'... 31.3s
Gradle task assembleDebug failed with exit code 1
Build failed :|
Failed to build for Android
any chance you have hardcoded path in your build.gradle or somewhere else? C:\\Users is not a valid path on Codemagic builder machines because it uses macOS or Linux

Android Studio could not find, download, attach code sources

I wanted to see CoroutineWorker (androidx.work:work-runtime-ktx:2.2.0) class code sources, but android studio (tried on versions: 4.1.3 and smaller) show decompiled version of that:
When I click download sources Gradle shows such error:
FAILURE: Build failed with an exception.
* Where:
Initialization script '/tmp/ijmiscinit4.gradle' line: 20
* What went wrong:
Execution failed for task ':app:DownloadSources'.
> Could not resolve all files for configuration ':app:downloadSources_2108a026-03c6-4d30-a902-3a53b9d5d155'.
> Could not find androidx.work:work-runtime-ktx:2.2.0#aar.
Required by:
project :app
* 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 1s
Could you please help what I am doing wrong here?
Second issue: even if sources are downloaded, AndroidStudio still won't attach them, here I've described that issue in detail.

Flutter: upgrading firebase_ml_vision dependency from 0.9.x to 0.10.0

My flutter project runs fine with Firebase ML Vision 0.9.x, if I try to upgrade to 0.10.0 (or higher), it yields the following errors:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\...\Cache\hosted\pub.dartlang.org\firebase_ml_vision-0.10.0\android\build.gradle' line: 26
* What went wrong:
A problem occurred evaluating project ':firebase_ml_vision'.
> Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?
* 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:
A problem occurred configuring project ':firebase_ml_vision'.
> compileSdkVersion is not specified. Please add it to build.gradle
* 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 889ms
Exception: Gradle task assembleDebug failed with exit code 1
The first of those two errors is weird because the setup instructions and the package install guidelines both say that firebase_core is not required (anymore).
The second is just plain wrong, as my app's build.gradle specifies compileSdkVersion 30 and the firebase_ml_vision package's build.gradle specifies compileSdkVersion 29.
Any ideas what's going on?
Found a solution that works:
Ignore the setup instructions and add firebase_core as a dependency. Then, add the 'implementations' according to this thread to solve the 'Duplicate class' issues.

Unable to run Flutter Project with Package

I created a new app.
Added audioplayers flutter package from https://pub.dev/packages/audioplayers.
Shows an error from Android Embedding. I followed the instructions https://flutter.dev/go/android-project-migration.
Now I get this error:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\audioplayers-0.17.1\android\build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':audioplayers'.
> Plugin with id 'kotlin-android' 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:
A problem occurred configuring project ':audioplayers'.
> compileSdkVersion is not specified.
* 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 3s
Exception: Gradle task assembleDebug failed with exit code 1
Then I followed https://github.com/react-native-webview/react-native-webview/issues/1407 thread to do what suggested.
Now I'm getting this error:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\src\flutter\flutter.pub-cache\hosted\pub.dartlang.org\audioplayers-0.17.1\android\build.gradle' line: 49
What went wrong:
A problem occurred evaluating project ':audioplayers'.
Could not get unknown property 'kotlin_version' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
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
Exception: Gradle task assembleDebug failed with exit code 1
I'm very new in android studio development, it drives me crazy with these configurations. Thank you very much.
For those who came up with the same problem I have. The project I'm working came from Git and I think that project wasn't updated for Android Embedding v2 so I got the first error.
Now in the second error, all I did was to read other's bug fixes (not officially).
Adding the dependencies and kotlin-version (1.4.20) needed for the main package(audioplayers). C:\flutter\flutter.pub-cache\hosted\pub.dartlang.org\audioplayers-0.17.1\android\
Making the android project's app build.gradle>defaultConfig>minSdkVersion to 23 (from 16)
Use pub get and update in pubspec.yaml.

Categories

Resources