Flutter - Error after include cloud firestore dependency.[Resolved] - firebase

I'd like a help to resolve this Issue. I cannot build my flutter application after insert the cloud firestore dependency at the pubspec.yaml
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.4.3+2
cloud_firestore: ^0.13.0+1
Error description:
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 io.grpc:grpc-core:[1.21.0].
Required by:
project :app > io.grpc:grpc-okhttp:1.21.0
Failed to list versions for io.grpc:grpc-core.
Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
Connection reset
Failed to list versions for io.grpc:grpc-core.
Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
Connection reset
Failed to list versions for io.grpc:grpc-core.
Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
Connection reset

This seems to be an internet connection problem, so please check your network.

This is more looking as if some connection issues are present,but if not then
First of all checkout your .gradle version it should be greater than 5
If you have created your project recently or under one month then you may need to check this step.
Then go to android/build.gradle and check your dependencies It should look like
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
If you donot use kotlin support then no need to write that classpath.Its for those who has kotlin support enabled by default.
In android/gradle.properties
you should have
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
in app level build.gradle
defaultConfig {
minSdkVersion 23
}
and most importantly you should have downloaded your google-services.json file in your android project folder. For Firebase you also require sha1 or sometimes sha256 keys.
Now it should run properly.
May it helped you :)
`

Related

Flutter firebase version conflict firebase messaging

I have a firebase flutter app, everything worked, but when I added firebase_messaging: ^5.1.4. The app gives this:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[18.0.
0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.firebase:firebase-messaging:18.0.0 -> com.google.firebase:firebase-iid#[18.0.0], but fire
base-iid version was 19.0.0.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends on project 'firebase_messaging' which depends onto com.google.firebase:firebase-messaging#18.0.
0
-- Project 'app' depends onto com.google.firebase:firebase-core#17.0.0
-- Project 'app' depends on project 'cloud_functions' which depends onto com.google.firebase:firebase-functions#17.0.0
-- Project 'app' depends on project 'firebase_core' which depends onto com.google.firebase:firebase-core#16.0.9
For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.
These are my other packages
firebase_auth: ^0.11.1+12
firebase_storage: ^3.0.4
cloud_firestore: ^0.12.7+1
cloud_functions: ^0.4.1+1
(they all work)
I have this in my build gradle: classpath 'com.google.gms:google-services:4.2.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
Is there a way of fixing this?
Thank you very much!
I'm currently trying this:
in the app level build.gradle I have this:
apply plugin: 'com.google.gms.google-services'
I'm adding this:
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
(after apply plugin: 'com.google.gms.google-services')
Include Firebase Core dependency in pub spec.yaml and not specifying the versions of firebase dependencies resolve most of the issues.
https://pub.dev/packages/firebase_core
run these two lines
rm Podfile.lock
pod install --repo-update
these will does the job. it took my two days to fix it

Flutter Firebase (firebase_core) does not build on Android

When using the Firebase plugins and starting an Android build, I get the following error:
ERROR: Failed to resolve: com.google.firebase:firebase-core:
Affected Modules: app, firebase_core.
It works fine on iOS.
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 find com.google.firebase:firebase-core:.
Required by:
project :app
project :app > project :firebase_core
This issue was fixed in the 0.3.4 update of firebase_core, which is a dependency of other Flutter Firebase plugins. You should be able to get the fix with a "flutter packages upgrade".
https://github.com/flutter/plugins/pull/1464/files
This is an issue that occurs because FlutterFire is migrating to BoM.
To solve this issue for now, you should just use firebase_core: 0.3.1+1.
The ideal solution would be adding the following to your settings.gradle in your android module:
enableFeaturePreview('IMPROVED_POM_SUPPORT')
However, this might not work. In that case, you should revert to 0.3.1+1 for the moment.
You can find out more about it here.

Firestore plugin causing build error for Flutter Android App

Trying to setup cloud_firestore in my Flutter project, and it loads fine for iOS. However, the build is failing for Android with the error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
In my pubspec.yaml I have:
cloud_firestore: ^0.8.2+3
I added this classpath to android/build.gradle:
classpath 'com.google.gms:google-services:4.0.1'
And this to app/build.gradle:
apply plugin: 'com.google.gms.google-services'
I believe I have done everything correctly in the Android setup for Firestore, but it still will not work. Any idea why it won't build for Android?

Could Not File: Corda Crash Shell during Gradle Build

We are using artifactory to connect through a firewall to the internet. When running ./gradlew clean build we get the following exception message:
Could not resolve all dependencies for configuration ':java-source:testCompileClasspath'.
> Could not find com.github.corda.crash:crash.shell:9d242da2a10e686f33a3aefc69e4768824ad0716.
Searched in the following locations:
http://code-artifacts.bankofamerica.com:18081/artifactory/virtual-java/com/github/corda/crash/crash.shell/9d242da2a10e686f33a3aefc69e4768824ad0716/crash.shell-9d242da2a10e686f33a3aefc69e4768824ad0716.pom
http://code-artifacts.bankofamerica.com:18081/artifactory/virtual-java/com/github/corda/crash/crash.shell/9d242da2a10e686f33a3aefc69e4768824ad0716/crash.shell-9d242da2a10e686f33a3aefc69e4768824ad0716.jar
Required by:
project :java-source > net.corda:corda-node-driver:1.0.0 > net.corda:corda-test-utils:1.0.0 > net.corda:corda-node:1.0.0
We are wondering if the version number of crash.shell is having an affect on jar lookup.
In Corda V1.0, net.corda:corda-node:1.0.0 lists com.github.corda.crash:crash.shell:9d242da2a10e686f33a3aefc69e4768824ad0716 as a compile dependency. This corresponds to https://github.com/corda/crash/tree/9d242da2a10e686f33a3aefc69e4768824ad0716/shell.
If you are behind a firewall and this dependency isn't present in your artifactory, the build will fail.
This is now in the R3 corda-dependencies repo so you just need to update your build.gradle:
repositories {
jcenter()
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases' }
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-dependencies' }
}

gradle sync failed due to ASCII open file

When i try to connect my project in firebase an error raise. It shows, gradle sync failed and ASCII open file. How to solve it? Please give a way.
I changed dependency at gradle.build - Project as follows :
dependencies { classpath 'com.android.tools.build:gradle:3.0.0' classpath 'com.google.gms:google-services:3.1.0' }

Resources