Android Question Getting Firebase Storage to work

Brian Dean

Well-Known Member
Licensed User
Longtime User
I have been trying for several months to set up Firebase Storage using FirebaseStorage - Simple file storage backend and Integrating Firebase Services. I have not yet succeeded - in fact I am getting more and more confused. I am trying to find out what I am not doing right. This is what I think I have done . . .

- I downloaded the "Storage Example.zip" file, unzipped and opened it.
- I set up a project called "Testbed1" in my Firebase console.
- I set up three folders - auth/, public/ and user/ in my Firebase project and applied the recommended access rules.
- I downloaded the google-services.json from the project and placed it in Shared Folders. I changed the package name value to "b4a.firebase" to match the B4A Build Configuration.
- I changed the bucket name in the Storage Example B4XMainPage to match my Firebase project bucket.

I have in the past successfully got the app to open, have activated the Google Login and activated the File Download button, although I have never suceeded in retrieving a file. But now I cannot even get the app to install - I have reached the point where I am becoming lost. The app does not run and I get this in the Log file . . .
An error occurred.
Error parsing manifest script:
Error parsing google-services.json:
Error parsing manifest script:
Error parsing json file. Make sure that the package name is correct.
The manifest script is, I believe, as downloaded with the example project . . .
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)

The package name in the build configuration is "b4a.firebase" and my json file is . . .
{
"project_info": {
"project_number": "############",
"project_id": "testbed1-688d4",
"storage_bucket": "testbed1-688d4.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "########........########",
"android_client_info": {
"package_name": "b4a.firebase"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "########........########"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

If anyone can see where I am going wrong and point me back towards the right road I will be very grateful. Meanwhile I am off to bed.
 
Top