firebase integration with flutter not successful with geolocation dependency - firebase

I'm wondering when I integrate firebase with flutter it works perfect ,
but if I add geolocation package in dependencies :
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.0
geolocation: ^0.2.1
I got this message in debug when i compile the project:
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
* 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 5s
Finished with error: Gradle build failed: 1
Any idea what is going on.?

I think your problem is with indentation.
Try with
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.0
geolocation: ^0.2.1

Related

Flutter build fails [Execution failed for "cloud_firestore-3.1.12".]

**FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':cloud_firestore'.
Could not load compiled classes for build file 'C:\src\flutter.pub-cache\hosted\pub.dartlang.org\cloud_firestore-3.1.12\android\build.gradle' from cache.
Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':cloud_firestore' of type org.gradle.api.Project.
Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Could not get unknown property 'android' for project ':cloud_firestore' of type org.gradle.api.Project.
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**
my current flutter project which uses the following firebase packages
cloud_firestore: ^3.1.12
firebase_core: ^1.14.1
firebase_auth: ^3.3.14
firebase_storage: ^10.2.12
firebase_messaging: ^11.2.13

Flutter - Firebase Analytics Dependency Error

I have been building an app, and I wanted analytics in that so I added firebase_analytics: ^6.0.0 as a dependency. But whenever I try to run the app in debug mode, I get this error
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> File 'com.android.builder.files.ZipCentralDirectory#479a9b01' was deleted, but previous version not found in cache
* 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 ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> File 'com.android.builder.files.ZipCentralDirectory#3cbd23b5' was deleted, but previous version not found in cache
* 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.
But if I remove it, it runs in debug mode without any problems.
So far, I ran flutter clean and then flutter pub get, and also tried Invalidating the cache and restarting, but neither of those worked.
Here's my pubspec.yaml excluding firebase_analytics
cupertino_icons: ^0.1.3
firebase_core: ^0.5.0
firebase_auth: ^0.18.0+1
cloud_firestore: ^0.14.0+2
fluttertoast: ^7.1.1
intl_phone_number_input: ^0.5.1

Getting error while adding firebase analytics in flutter app

Got this error after adding firebase_analytics in pubsec.yaml file.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':firebase_core:compileDebugAidl'.
> The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0]], but resolves to 16.0.3. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
* 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 5s
Finished with error: Gradle task assembleDebug failed with exit code 1
these are dependencies in pubsec.yaml
dependencies:
firebase_analytics:
cloud_firestore:
graphql_flutter: ^1.0.0
firebase_auth:
firebase_core:
mobx: ^0.1.2
flutter_mobx: ^0.1.1
mobx_codegen: ^0.1.0+1
carousel_pro: ^0.0.13
cupertino_icons: ^0.1.2
flutter:
sdk: flutter
thanks
I'm unable to replicate the behavior you've reported at present. Per checking the comments, it looks like that the issue has been solved. Running flutter clean should also solve most conflicts caused in the dependencies cache. 

flutter sqllite not woring

I m writing a flutter application and i m trying to learn using SQLite, as per document i added package in dependencies and run command to get it .
it gives error while compiling
dependencies:
flutter:
sdk: flutter
sqflite: ^1.1.5
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
i m expecting application to run but it gives error
PS D:\my\flutter\snapexpense_new> flutter run
Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle... 1.2s
Resolving dependencies... 3.8s
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':sqflite:lintClassPath'.
> Could not download kotlin-compiler.jar (com.android.tools.external.com-intellij:kotlin-compiler:26.2.1)
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/26.2.1/kotlin-compiler-26.2.1.jar'.
> Connection reset
* 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
Running Gradle task 'assembleDebug'... Done 120.2s (!)
Gradle task assembleDebug failed with exit code 1
The day I was also with this problem but fortunately I settled after a lot of research time.
First step
you must download kotlin-compiler.jar
Second step
Open your project flutter go to the folder that is in the image above and paste the kotlin-compiler.jar
After all this done open your flutter project and update your dependencies, and when you finish back to run application.
For me it worked hope it works for you too.

Flutter: Can't update the firebase_auth package from 0.5.11 to 0.6.6

I'm trying to update the package in order to solve this problem. When I change the firebase_auth version on my pubspec.yaml I obtain this:
error
Configure project :firebase_auth
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':firebase_auth'.
> Could not open cp_proj remapped class cache for 1hd54il9uhc3eutyaybhw2pq0
(~/.gradle/caches/4.10.2/scripts-remapped/build_7iuv4c9gs2g2ad3uvhc3eae18/1hd54il9uhc3eutyaybhw2pq0/cp_proj70b1361a260e0ceb212a59c45f680ebd).
> Unexpected lock protocol found in lock file. Expected 3, found 0.
* 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 0s
Command: ~/git-repo/mine-repo/printer_products/android/gradlew app:properties
Please review your Gradle project setup in the android/ folder.
pubspec
dependencies:
flutter:
sdk: flutter
#firebase_auth: ^0.5.11
firebase_auth: ^0.6.6
google_sign_in: ^3.0.4
firebase_core: ^0.2.5+1
cloud_firestore: ^0.7.3
firebase_storage: ^1.0.4
image_picker: ^0.4.10
http: ^0.12.0
uuid: ^1.0.3
mime: ^0.9.6+2
shared_preferences: "^0.4.3"
rxdart: "^0.19.0"
scoped_model: "^1.0.1"
Seems that only the combination of firebase_auth: 0.5.11 and google_sign_in: 3.0.4 works.
When I realized that the problem was not caused directly by the package and its update, I found the solution on this question. I simply removed the cache mentioned on the error: rm -rf ~/.gradle/caches/4.10.2

Resources