Hi; I'm dealing with this problem and I can't solve it.
B4A 9.50
All library files and versions are complete. Even FirebaseAnalytics 1.12
<uses-sdk android: minSdkVersion = "14" android: targetSdkVersion = "28" />
<supports-screens android: largeScreens = "true"
android: normalscreens = "true"
android: smallscreens = "true"
android: anydensity = "true" />)
#if free
CreateResourceFromFile (Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile (Macro, FirebaseAuth.FirebaseAuth)
CreateResourceFromFile (Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile (Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile (Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile (Macro, FirebaseAdMob.FirebaseAds)
#end if
I get the error on the auth.Initialize ("auth") line.
java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process xxxxxxxxxxxx. Make sure to call FirebaseApp.initializeApp (Context) first.
I couldn't figure it out. This application worked through 23 versions. In fact, according to API28 compiled version is available in the market. My SDKs and Extra are fully installed. I don't understand what's changed.
My Manifest File ;
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
'CreateResourceFromFile(Macro, Themes.DarkTheme)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:largeHeap, "true" )
SetApplicationAttribute("android:theme","@android:style/Theme.Holo.Light.NoActionBar.Fullscreen")
SetActivityAttribute(popup,"android:theme","@android:style/Theme.Translucent.NoTitleBar")
#if free
CreateResourceFromFile (Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile (Macro, FirebaseAuth.FirebaseAuth)
CreateResourceFromFile (Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile (Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile (Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile (Macro, FirebaseAdMob.FirebaseAds)
#end if
CreateResourceFromFile ("google-services", "google-services.json")
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.ACCESS_MOCK_LOCATION)
AddPermission(android.permission.CALL_PHONE)
AddPermission(android.permission.CAMERA)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission(android.permission.READ_EXTERNAL_STORAGE)
AddPermission(android.permission.WRITE_CALENDAR)
SetApplicationAttribute(android:networkSecurityConfig, @xml/network_security_config)
CreateResource(xml, network_security_config.xml,
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
)
AddApplicationText(
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
)
AddApplicationText(
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="$PACKAGE$.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
)
CreateResource(xml, provider_paths,
<external-files-path name="name" path="shared" />
)
AddManifestText(<permission
android:name=".$PACKAGE$.permission.MAPS_RECEIVE"
androidrotectionLevel="signature"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>)
AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
<meta-data android:name="com.google.android.gms.version" android:value="@Integer/google_play_services_version"/>
)
'************ Facebook Login ****************
AddApplicationText(<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>)
'************ Facebook Login (end) **********
CreateResource(values, facebook.xml, <resources>
<string name="facebook_app_id">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</string>
</resources>)
'************ Google Play Services Base ************
AddApplicationText(
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version" />
)
'************ Google Play Services Base (end) ************
B4A 9.50
All library files and versions are complete. Even FirebaseAnalytics 1.12
<uses-sdk android: minSdkVersion = "14" android: targetSdkVersion = "28" />
<supports-screens android: largeScreens = "true"
android: normalscreens = "true"
android: smallscreens = "true"
android: anydensity = "true" />)
#if free
CreateResourceFromFile (Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile (Macro, FirebaseAuth.FirebaseAuth)
CreateResourceFromFile (Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile (Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile (Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile (Macro, FirebaseAdMob.FirebaseAds)
#end if
I get the error on the auth.Initialize ("auth") line.
java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process xxxxxxxxxxxx. Make sure to call FirebaseApp.initializeApp (Context) first.
I couldn't figure it out. This application worked through 23 versions. In fact, according to API28 compiled version is available in the market. My SDKs and Extra are fully installed. I don't understand what's changed.
My Manifest File ;
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
'CreateResourceFromFile(Macro, Themes.DarkTheme)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:largeHeap, "true" )
SetApplicationAttribute("android:theme","@android:style/Theme.Holo.Light.NoActionBar.Fullscreen")
SetActivityAttribute(popup,"android:theme","@android:style/Theme.Translucent.NoTitleBar")
#if free
CreateResourceFromFile (Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile (Macro, FirebaseAuth.FirebaseAuth)
CreateResourceFromFile (Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile (Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile (Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile (Macro, FirebaseAdMob.FirebaseAds)
#end if
CreateResourceFromFile ("google-services", "google-services.json")
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.ACCESS_MOCK_LOCATION)
AddPermission(android.permission.CALL_PHONE)
AddPermission(android.permission.CAMERA)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission(android.permission.READ_EXTERNAL_STORAGE)
AddPermission(android.permission.WRITE_CALENDAR)
SetApplicationAttribute(android:networkSecurityConfig, @xml/network_security_config)
CreateResource(xml, network_security_config.xml,
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
)
AddApplicationText(
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
)
AddApplicationText(
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="$PACKAGE$.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
)
CreateResource(xml, provider_paths,
<external-files-path name="name" path="shared" />
)
AddManifestText(<permission
android:name=".$PACKAGE$.permission.MAPS_RECEIVE"
androidrotectionLevel="signature"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>)
AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
<meta-data android:name="com.google.android.gms.version" android:value="@Integer/google_play_services_version"/>
)
'************ Facebook Login ****************
AddApplicationText(<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>)
'************ Facebook Login (end) **********
CreateResource(values, facebook.xml, <resources>
<string name="facebook_app_id">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</string>
</resources>)
'************ Google Play Services Base ************
AddApplicationText(
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version" />
)
'************ Google Play Services Base (end) ************