React Native Firebase installation does not work - android

Hi I'm following the guidelines of https://rnfirebase.io/docs/v3.1.x/installation/initial-setup to install firebase for React Native. I'm using an Android Emulator.
After everything is done I cannot start the application. That's what happens when starting the app via 'react-native run-android':
Parsing json file: C:\Users\Studium\WebstormProjects\app-programming\android\app\google-services.json
:app:processDebugGoogleServices FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
Failed to create folder: C:\Users\Studium\WebstormProjects\app-programming\android\app\build\generated\res\google-services\debug
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: 25.864 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
Does someone know what I did wrong?

In firebase console, you can get google-services.json file and place it in android/app directory and get googleServices-info.plist file and place it in /ios directory
if you want to use analytics only use firebase analytics it works for me.

Related

Flutter VSCode : Debug error:Could not create service of type FileHasher using BuildSessionServices.createFileHasher()

Trying to start programming Dart in Flutter. I wanted to work with VSCode instead of Android Studio, but when debug session starts I get the following problems.
I tried everything here in this link such as deleting the caches, deleting lock file, kill PID Task in cmd, but nothing works.
However, I'm able to run the test app in Android Studio, but still, I wanted to learn via VSCode. It will be great if you can share any suggestion that might help :)
Thanks!
FAILURE: Build failed with an exception.
* What went wrong:
Gradle could not start your build.
> Could not create service of type FileHasher using BuildSessionServices.createFileHasher().
> 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
Flutter SDK: windows 1.17.1 (from the website)
Android Studio: 3.6.3
Able to solve my own problem. Apparently, when I first sync the demo app in VSCode, it started to download package from gradle 5.62, whereas 6.4 available in my machine. Which then I changed the setting and distributionUrl thingy to that version 6.4 . And when I started to run it, that error stated in the question surfaced.
What I did was:
Go to project level .gradle file (app> android> .gradle)
Delete the file of gralde of the other version
Go to the gradle folder of the 6.4 version, delete the lock file in caches/filehashes
restart
In android/app/build.gradle
Try changing minSdkVersion to 21
I had same issue this worked
For Windows machine:
Open Task Manager(Ctrl-Alt-Delete and check Process)
-> Close All instances of Android Studio/VS Code (End Task)
-> Close Emulator (if Running)
-> Then close OpenJDK Platform Binary
it will work now

Flutter App gradle build failing after adding flutter_contact plugin

My Flutter app was working fine. But failing now after I added the flutter_contact 0.5.3 package.
Please find the gradle Stack trace
FAILURE: Build 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#53232d9e' 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.
Get more help at https://help.gradle.org
Kindly Help
-
flutter channel stable
flutter upgrade --force
flutter pub cache repair
cd
flutter clean
This will probably solve your question
I had the same issue. Used IOBit Unlocker to unlock the project folder - then ran flutter clean. Everything builds fine now)
IOBit Unlocker: https://ru.iobit.com/iobit-unlocker.php
In my case, just run flutter run inside the project folder and it was solved.

React Native failed to find target with hash string 'android-23' React Native

I have been following this link to get started with react native
https://facebook.github.io/react-native/docs/getting-started.html
When i try to run this command react-native run-android in my project folder I get the following error
`FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
failed to find target with hash string 'android-23' in: /home/knolly/Android/Sdk/platforms
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: 16.225 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have`
ANDROID_HOME is set in ~/.bashrc and platforms folder contain android-23.
What am I doing wrong here ?
The problem seems to be that you don't have installed the correct SDK required by RN.
If you open the file android/app/build.gradle you'll find the following line:
compileSdkVersion 23
buildToolsVersion "23.0.1"
Make sure that, on Android Studio, you have the correct SDK version installed:
And the correct SDK tools:
please try to open your "android" folder under react native project with "Android Studio".
It'll help you install all of missing build tool.

Android studio build failed exception while build with different emulator?

Error:FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:clean'.
Unable to delete directory: /media/user/7EA01F5FA01F1CE9/GitWorkSpace/Myapplication/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.3.0/jars
Try: Run with --stacktrace option to get the stack trace. Run with
--debug option to get more log output.
How to fix this issue in android studio? Whenever i'm trying to take build in different emulator i have to delete manually build folder inside the app then only i can successfully build the application.
How to fix this issue permanently?
I have faced the same problem, my android studio version 2.0 and OS Ubuntu. So, far I didn't found any permanent solution and this problem is current IDE version. You can also check details from here:
https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened&groupby=&sort=&id=206219
So, you can use lower IDE version temporarily (I know this is not a good solution)

Cannot make react-native-maps to work on android

I'm trying to create a simple "weather" app using react-native on Android.
I have followed the installation steps but I get following errors when I run react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
A problem occurred configuring project ':react-native-maps'.
Could not resolve all dependencies for configuration ':react-native-maps:_debugCompile'.
Could not find com.google.android.gms:play-services-base:8.3.0.
Searched in the following locations:
file:/home/mihir/.m2/repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.pom
file:/home/mihir/.m2/repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.jar
https:// jcenter.bintray.com/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.pom
https:// jcenter.bintray.com/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.jar
file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.pom
file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.jar
Required by:
weather:react-native-maps:unspecified
Could not find com.google.android.gms:play-services-maps:8.3.0.
Searched in the following locations:
file:/home/mihir/.m2/repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.pom
file:/home/mihir/.m2/repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.jar
https:// jcenter.bintray.com/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.pom
https:// jcenter.bintray.com/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.jar
file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.pom
file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.jar
Required by:
weather:react-native-maps:unspecified
* 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: 20.584 secs
Could not install the app on the device, rea
You need to install Google Play Services to make react-native-maps work on Android.
Go in a terminal and run android. This should open the SDK manager.
If the command android is not found, you need to install the SDK tools from here
Install Google Play Services and Google Repository.
Rerun react-native run-androidand it should work if you use a device.
If you use an emulator, check this.

Categories

Resources