FirebaseApp initialization unsuccessful - android

Try using firebase library for Android, followed all the steps in the firebase documents, when I apply the instructions show me in logcat
FirebaseApp initialization unsuccessful.
Images
Who can help , please

I found the answer in The Google Services Gradle Plugin
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="default_web_client_id" translatable="false">1035469437078-e8mr503bun5eaevqctn4u807q4hpi44s.apps.googleusercontent.com</string>
<string name="gcm_defaultSenderId" translatable="false">1035469437078</string>
<string name="firebase_database_url" translatable="false">https://myapp.firebaseio.com</string>
<string name="google_app_id" translatable="false">1:1035469437078:android:73a4fb8297b2cd4f</string>
<string name="google_api_key" translatable="false">AIzaSyFE3G2eN0XZPl-IeEvZhzKOAgC9vy9imVE</string>
<string name="google_storage_bucket" translatable="false">myapp.appspot.com</string>
</resources>
gcm_defaultSenderId:
project_info/project_number
google_app_id:
{YOUR_CLIENT}/client_info/mobilesdk_app_id
google_api_key:
{YOUR_CLIENT}/services/api_key/current_key
google_storage_bucket:
project_info/storage_bucket
firebase_database_url:
project_info/firebase_url
default_web_client_id:
{YOUR_CLIENT}/oauth_client/[first client_type 3]

Make sure you've already inserting google-services-json inside app folder and you have stable internet connection, firebase will perform download package when gradle sync process.

Related

Ionic - Android authorities: FacebookContentProvider undefined in android manifest

Can’t install because provider name com.facebook.app.FacebookContentProviderundefined (in package io.ionic.sxxxx) is already used by io.ionic.yyyyy]"
This is listed in a few android manifest files
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider"
android:exported="true" />
on build I get
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProviderundefined"
android:exported="true" />
— notice the undefined ----- should I be defining something somewhere? Is there another solution? Basically I have a pair of apps that will not install at the same time on a device because this output is the same. My understanding is undefined should be my facebook id. I do have a variety of values defined in my android strings file. I have seen a few answers from a couple years ago on here (Android Facebook content provider authority) , but the solutions do not work as the files in my android directory are different as are their contents. Any help would be much appreciated!
<string name="title_activity_main">xxxx</string>
<string name="package_name">io.ionic.xxxx</string>
<string name="custom_url_scheme">io.ionic.xxxx</string>
<string name="fb_app_id">xxxxx</string>
<string name="facebook_app_id">xxxxx</string>
<string name="fb_app_name">xxxxx</string>
<string name="fb_login_protocol_scheme">fbxxxxxx</string>
<string name="fb_auto_log_app_events_enabled">true</string>
<string name="fb_advertiser_id_collection_enabled">true</string>
I have tried deleting all of the tags from all of the android manifest files, but they are generated on build. I have tried adding a string called authority in my string.xml file. I have struggeled to figure out how to implement the solutions here, as they dont exactly align with the files in my ionic project. Android Facebook content provider authority.
There is an open issue about this on GitHub:
https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/100
Did you try the temporary solutions provided in the comments?
HCJSolutions commented on Dec 10, 2021
I found a temporary solution is add ${applicationId}
modified the platforms\android\app\src\main\AndroidManifest.xml find a
node 123456789"
android:exported="true"
android:name="com.facebook.FacebookContentProvider" />
or
change it at
plugin folder plugins\cordova-plugin-facebook-connect\plugin.xml find
the line <provider
android:authorities="com.facebook.app.FacebookContentProvider${applicationId}$APP_ID"
and
apren commented on Apr 24:
Another temporary solution:
Set any APP_ID, for example APP_ID = "app_package_name" After init app
use code
facebookConnectPlugin.setApplicationId('your_facebook_app_id')

Android Build Failed, strings/google_app_id duplicate resources error

I am working on ionic 4. When I run this command in cmd:
ionic Cordova build android
It gives me a duplicate resource error. I am using firebase and google services.json plugins in my project.
I have tried to remove google_app_id and google_api_key from Andriod.xml file but no change. The same error is displaying again and again. Here is the view of the android.xml file.
Android.xml File
"res/values/strings.xml": {
"parents": {
"/resources": [
// removed google_app_id & google_api_key
]
}
}
}
Strings.xml File:
<resources>
<string name="app_name">UrbanX Driver</string>
<string name="launcher_name">#string/app_name</string>
<string name="activity_name">#string/launcher_name</string>
<string name="google_app_id">#string/google_app_id</string>
<string name="google_api_key">#string/google_api_key</string>
</resources>
Config.xml File:
<resource-file src="google-services.json" target="app/google-services.json" />
Install this plugin cordova-android-play-services-gradle-release:
ionic cordova plugin add cordova-android-play-services-gradle-release
check this link for reason:
https://github.com/arnesson/cordova-plugin-firebase#google-play-services

how to resolve Error Cannot find symbol variable youtube_url in android studio

I am Stuck in Error: Cannot find symbol variable youtube_url in android studio everything is fine but this error stopping me to build gradle please help.
Remove
activity.getString(R.string.youtube_url)
and write url of youtube video to be shown "www.youtube.com/key"
or
define a string value with name youtube_url in your strings and place url to load
Under your app folder, look for a folder called res then a folder called values then a file called Strings.xml (app/res/values/Strings.xml).
The file likely looks like this:
<resources>
<string name="app_name">My App</string>
</resources>
Inside there you need create another String!
<string name="youtube_url">Hello World</string>
You can read more here:
https://developer.android.com/guide/topics/resources/providing-resources

google_maps_key was entered but still blank/didn't work

i use demo sample script for build google map client on android,
in ..ApiDemos\app\src\release\res\values\google_maps_api.xml
<string name="google_maps_key" translatable="false" templateMergeStrategy="preserve">
AIzaSyA76USspcg333E7Wh11RIkNRuuXXXXXXX
</string>
i was entered make api key like in documentations procedur step by step, but is't still not working
..\ApiDemos\app\src\main\AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapdemo">
i use the package like on Manifest
and use the package as SHA-1 signing-fingerprint
its not just for this build app..
in other myproject also dint work
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyA76USspcg333E7Wh11RIkNRuuQQPSQy6Y"/>

Compiling error with Android Phonegap app

I'm using Phonegap and Barcode Scanner plugin. I'm trying to build an test application. I'm following below tutorial.
http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt3
I have paste the BarcodeScanner.java to the correct path, as you see in the image.
But when compiling following error happens:
Android Packager: [phonegapbarcode] C:\Users\achintha_s\IdeaProjects\Barcode PhoneGap\AndroidManifest.xml:59: error: Error: No resource found that matches the given name (at 'label' with value '#string/share_name').
How can I solve this? I'm using IntelliJ Studio.
Check the strings.xml in values folder of res folder whether there is a string with name share_name as below:
<string name="share_name">My App Name</string>
and the strings.xml file should like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="share_name">My app Name</string>
</resources>
Make sur you've a stringname share_name in your String.xml file.
<string name="share_name">My App</string>

Categories

Resources