After setting up a react-native project (react-native-starter-kit-instamobile), ran npm install followed by run-android. I am getting the a build error.
FAILURE: Build failed with an exception.
What went wrong:
Failed to notify dependency resolution listener.
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.1.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
The library com.google.firebase:firebase-analytics is being requested by various other libraries at [[16.0.3,16.0.3]], but resolves to 16.0.6. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Related
I am building a flutter app that uses several firebase dependencies but the cloud_firestore dependency always returns errors when debugging and building the app.
Here is the Build Log
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'...
Note: /flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.13.4+2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Calling mockable JAR artifact transform to create file: /Users/user/.gradle/caches/transforms-2/files-2.1/323813f5a095cba9aa563dadb749a1cb/android.jar with input /Users/user/Library/Android/sdk/platforms/android-28/android.jar
Calling mockable JAR artifact transform to create file: /Users/user/.gradle/caches/transforms-2/files-2.1/ff23381473fa92d0c047c8663bfbe6a6/android.jar with input /Users/user/Library/Android/sdk/platforms/android-27/android.jar
Calling mockable JAR artifact transform to create file: /Users/user/.gradle/caches/transforms-2/files-2.1/43c9f60e6803ddaaef16828845e40f49/android.jar with input /Users/user/Library/Android/sdk/platforms/android-29/android.jar
Removed unused resources: Binary resource data reduced from 329KB to 261KB: Removed 20%
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':google_sign_in:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/Users/user/.gradle/caches/transforms-2/files-2.1/9dacf9516413cf5e5b34c6b4508340e4/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/user/.gradle/caches/transforms-2/files-2.1/9dacf9516413cf5e5b34c6b4508340e4/core-1.0.0/res/values/values.xml:57:5-88: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 7m 10s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 441.0s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
✏️ Creating 'android/settings_aar.gradle'... 35ms
✓ 'android/settings_aar.gradle' created successfully.
Building plugin cloud_firestore...
The plugin cloud_firestore could not be built due to the issue above.
pubspec.yaml firebase dependencies used:
firebase_core: ^0.4.4+3
cloud_firestore: ^0.13.4+2
firebase_auth: ^0.15.5+2
Anyone with working firebase dependencies kindly share them below.
Seems that is a transient issue and some piece of the tools stack is not synchronized correctly.
My suggestion is to reload the dependencies and the tools involved since in the Issue Tracker things like Android Studio, or Gradle are restored by:
Removing folders: /.gradle and /.gradle
Trying to setup using local gradle distribution.
Hope this was useful!
To solve this problem, try two things:
In project/android/app/build.gradle
defaultConfig {
...
multiDexEnabled true
}
In terminal run flutter pub upgrade
When I create basic IONIC 4 application and run > ionic cordova build android
it works fine and apk generated.
When I add plugin firebase > ionic cordova plugin add cordova-plugin-firebase
It failed to build application.
ERROR:
\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
I am fairly new to VSTS and the whole Microsoft Online Services Platform.
I am facing a problem when trying to initialise a build on our VSTS repository. I have selected the default Android build setting from the drop down menu, but it does not work. Every time I try to build, I reach the gradlew build stage and I get the error: Error: D:\a\1\s\gradlew.bat failed with return code: 1
I can build the code using the android Studio IDE, but I now need to use VSTS.
`
Any help would be much appreciated. Thank you!
EDIT: Here is the full log of the build
2018-07-28T19:23:31.6824618Z ##[section]Starting: gradlew build
2018-07-28T19:23:31.6830050Z ==============================================================================
2018-07-28T19:23:31.6830213Z Task : Gradle
2018-07-28T19:23:31.6830359Z Description : Build using a Gradle wrapper script
2018-07-28T19:23:31.6830487Z Version : 2.137.1
2018-07-28T19:23:31.6830608Z Author : Microsoft Corporation
2018-07-28T19:23:31.6830766Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613720)
2018-07-28T19:23:31.6830930Z ==============================================================================
2018-07-28T19:23:33.2899535Z SonarQube analysis is enabled.
2018-07-28T19:23:33.2900156Z Checkstyle analysis is enabled.
2018-07-28T19:23:33.2900406Z FindBugs analysis is enabled.
2018-07-28T19:23:33.2900654Z PMD analysis is enabled.
2018-07-28T19:23:33.2900905Z SYSTEMVSSCONNECTION exists true
2018-07-28T19:23:33.2901941Z [command]C:\Windows\system32\cmd.exe /D /S /C "D:\a\1\s\gradlew.bat build sonarqube -I D:\a\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\2.137.1\node_modules\codeanalysis-common\checkstyle.gradle -I D:\a\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\2.137.1\node_modules\codeanalysis-common\findbugs.gradle -I D:\a\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\2.137.1\node_modules\codeanalysis-common\pmd.gradle"
2018-07-28T19:24:05.3436260Z Downloading https://services.gradle.org/distributions/gradle-4.6-all.zip
2018-07-28T19:24:29.2233239Z Unzipping C:\Users\VssAdministrator\.gradle\wrapper\dists\gradle-4.6-all\bcst21l2brirad8k2ben1letg\gradle-4.6-all.zip to C:\Users\VssAdministrator\.gradle\wrapper\dists\gradle-4.6-all\bcst21l2brirad8k2ben1letg
2018-07-28T19:25:41.8632779Z Starting a Gradle Daemon (subsequent builds will be faster)
{A series of downloads for the packages we use, omitted for character limit's sake}
2018-07-28T19:26:20.6092629Z Applying the Checkstyle plugin to project s
2018-07-28T19:26:20.6792218Z Applying the FindBugs plugin to project s
2018-07-28T19:26:20.6792841Z Applying the PMD plugin to all projects
2018-07-28T19:26:23.9485033Z Applying the Checkstyle plugin to project volve
2018-07-28T19:26:23.9621010Z Applying the FindBugs plugin to project volve
2018-07-28T19:26:23.9621425Z Applying the PMD plugin to all projects
2018-07-28T19:26:28.6406403Z support library package not found: android.support.constraint.
2018-07-28T19:26:28.6407012Z support library package not found: android.support.constraint.motion.
2018-07-28T19:26:28.6407656Z support library package not found: android.support.constraint.
2018-07-28T19:26:28.6407994Z support library package not found: android.support.constraint.
2018-07-28T19:26:28.6408285Z support library package not found: android.support.constraint.
2018-07-28T19:26:28.6408525Z support library package not found: android.support.constraint.
2018-07-28T19:26:28.6408784Z support library package not found: android.support.constraint.
2018-07-28T19:26:28.6409785Z support library package not found: android.support.constraint.
2018-07-28T19:26:28.6410031Z support library package not found: android.support.constraint.
2018-07-28T19:26:28.6410325Z support library package not found: android.support.constraint.
2018-07-28T19:26:28.6410567Z support library package not found: android.support.constraint.
2018-07-28T19:26:28.6410830Z support library package not found: android.support.constraint.
2018-07-28T19:26:39.5509667Z Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
2018-07-28T19:26:39.6403284Z registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
2018-07-28T19:26:39.7610924Z registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
2018-07-28T19:26:39.7830309Z Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
2018-07-28T19:26:39.7922748Z registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
2018-07-28T19:26:39.8933520Z registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
2018-07-28T19:26:39.9253837Z
2018-07-28T19:26:39.9254479Z FAILURE: Build failed with an exception.
2018-07-28T19:26:39.9254716Z
2018-07-28T19:26:39.9254905Z * What went wrong:
2018-07-28T19:26:39.9255123Z Task 'sonarqube' not found in root project 's'.
2018-07-28T19:26:39.9255269Z
2018-07-28T19:26:39.9255429Z * Try:
2018-07-28T19:26:39.9255675Z Run gradlew tasks to get a list of available tasks. 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.
2018-07-28T19:26:39.9255897Z
2018-07-28T19:26:39.9256078Z * Get more help at https://help.gradle.org
2018-07-28T19:26:39.9256222Z
2018-07-28T19:26:39.9256413Z BUILD FAILED in 2m 49s
2018-07-28T19:26:40.5195018Z Error: D:\a\1\s\gradlew.bat failed with return code: 1
2018-07-28T19:26:40.5195970Z at ChildProcess.<anonymous> (D:\a\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\2.137.1\node_modules\vsts-task-lib\toolrunner.js:569:30)
2018-07-28T19:26:40.5196934Z at emitTwo (events.js:106:13)
2018-07-28T19:26:40.5197445Z at ChildProcess.emit (events.js:191:7)
2018-07-28T19:26:40.5198292Z at maybeClose (internal/child_process.js:886:16)
2018-07-28T19:26:40.5198771Z at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
2018-07-28T19:26:40.6483964Z ##[warning]No test result files matching D:\a\1\s\**\TEST-*.xml were found, so publishing JUnit test results is being skipped.
2018-07-28T19:26:40.6494902Z ##[error]Error: D:\a\1\s\gradlew.bat failed with return code: 1
2018-07-28T19:26:40.6541754Z ##[section]Finishing: gradlew build
You can use Android build template to build your android project in VSTS.
Detail configuration for Gradle task as below:
Gradle wrapper: relative path to gradlew file
Working directory: same directory where gradlew file exist. It use $(Build.SourcesDirectory) directory by default.
Tasks: build
Such as if the android project with the file structure as intro_android_demo (gradlew file in the root directory of the repo), then the Gradle task configuration should as below:
I use Ionic 3.4.0 to build android app, when I follow FCM firebase plugin docs
I get error during building android app. I did following:
1 Install plugin:
ionic cordova plugin add cordova-plugin-fcm
npm install --save #ionic-native/fcm
2 Run build android app:
ionic cordova build android
3 I got following error:
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
ANDROID_HOME=/home/tong/eproject/android
JAVA_HOME=/usr/lib/jvm/java-8-oracle/
Subproject Path: CordovaLib
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default
version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use
Task.doLast(Action) instead.
at
build_6dhr8ioykw4yco44wd3y0fmi8.run(/home/tong/eproject/ionic/MyInoicProject/platforms/android/build.gradle:138)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please
use TaskInputs.file(Object).skipWhenEmpty() instead.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not find com.google.firebase:firebase-core:9.0.0.
Required by:
project :
> Could not find any matches for com.google.firebase:firebase-core:+ as no versions of
com.google.firebase:firebase-core are available.
Required by:
project :
> Could not find any matches for com.google.firebase:firebase-messaging:+ as no versions of
com.google.firebase:firebase-messaging are available.
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 24.847 secs
Error: /home/tong/eproject/ionic/MyInoicProject/platforms/android/gradlew: Command failed with exit code 1 Error
output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not find com.google.firebase:firebase-core:9.0.0.
Required by:
project :
> Could not find any matches for com.google.firebase:firebase-core:+ as no versions of
com.google.firebase:firebase-core are available.
Required by:
project :
> Could not find any matches for com.google.firebase:firebase-messaging:+ as no versions of
com.google.firebase:firebase-messaging are available.
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
It seems like I am missing com.google.firebase:firebase-core:9.0.0 I read from this post but it does not work when I try to update google services. Please help me thanks.
I am working on a professionel project with Ionic 2. I have the presentation with clients coming monday (24/04/2017). Unfortunately from last Friday i am facing a conflict with cordova plugins. The application works well with IOS but build fails with Android. I think the conflict comes with :
cordova-plugin-mauron85-background-geolocation "CDVBackgroundGeolocation"
cordova-plugin-fcm "FCMPlugin"
At the beggining i had a version conflict, so i changed the version into cordova-plugin-mauron85-background-geolocation with framework src="com.google.android.gms:play-services-location:9.0.0". The error was :
Found com.google.android.gms:play-services-location:+, but version 9.0.0 is needed for the google-services plugin.
:processDebugGoogleServices FAILED
After solved the version conflict, now i am facing a new problem. The problem is:
:transformClassesWithDexForDebug
FAILED
>FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/api/zza;
And as i have always in my console the following message, i have tried to fix it manually. I tried to apply some solutions that i have found by searches.
The message in console is :
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
The manual fix was adding the following lines in my platforms/android/build.graddle (in correct places):
classpath 'com.google.gms:google-services:3.0.0' (in classpath dependencies)
apply plugin: 'com.google.gms.google-services' (at the bottom of the file)
But i got the following error with this modification, so i deleted them :
>FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
Cannot add task ':processDebugGoogleServices' as a task with that name already exists.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
My platforms/android/project.properties :
target=android-24
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-fcm/myProjectV2-FCMPlugin.gradle
cordova.gradle.include.2=cordova-plugin-mauron85-background-geolocation/myProjectV2-logtofile.gradle
cordova.system.library.3=com.google.android.gms:play-services-location:9.0.0
cordova.system.library.4=com.android.support:support-v4:+
Hope that i will get some help.
Thanks.