Android Question FirebaseRemoteConfig Error

SMOOTSARA

Active Member
Licensed User
Longtime User
Hello friends


I'm using the FirebaseRemoteConfig 2.52 library and now updating everything from SDK Manager does not work for me anymore.
I get an error when trying to initialize.
It worked properly before the update sdk and B4A ver 10.2 beta

B4X:
(NullPointerException) java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.remoteconfig.FirebaseRemoteConfig com.google.firebase.remoteconfig.RemoteConfigComponent.getDefault()' on a null object reference


and

B4X:
*** Service (starter) Create ***
remote_host_initialize (B4A line: 31)
cfg.Initialize("Config")
java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.remoteconfig.FirebaseRemoteConfig com.google.firebase.remoteconfig.RemoteConfigComponent.getDefault()' on a null object reference
    at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(FirebaseRemoteConfig.java:87)
    at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(FirebaseRemoteConfig.java:81)
    at de.donmanfred.FirebaseRemoteConfigwrapper.Initialize(FirebaseRemoteConfigwrapper.java:36)
    at xxxx.xxx.com.remote_host._initialize(remote_host.java:696)
    at xxxx.xxx.com.starter._service_create(starter.java:404)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at xxxx.xxx.com.starter.onCreate(starter.java:56)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3953)
    at android.app.ActivityThread.access$1500(ActivityThread.java:219)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1875)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7356)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
java.lang.RuntimeException: Unable to create service xxxx.xxx.com.starter: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.remoteconfig.FirebaseRemoteConfig com.google.firebase.remoteconfig.RemoteConfigComponent.getDefault()' on a null object reference
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3965)
    at android.app.ActivityThread.access$1500(ActivityThread.java:219)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1875)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7356)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.remoteconfig.FirebaseRemoteConfig com.google.firebase.remoteconfig.RemoteConfigComponent.getDefault()' on a null object reference
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:250)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at xxxx.xxx.com.starter.onCreate(starter.java:56)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3953)
    ... 8 more
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.remoteconfig.FirebaseRemoteConfig com.google.firebase.remoteconfig.RemoteConfigComponent.getDefault()' on a null object reference
    at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(FirebaseRemoteConfig.java:87)
    at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(FirebaseRemoteConfig.java:81)
    at de.donmanfred.FirebaseRemoteConfigwrapper.Initialize(FirebaseRemoteConfigwrapper.java:36)
    at xxxx.xxx.com.remote_host._initialize(remote_host.java:696)
    at xxxx.xxx.com.starter._service_create(starter.java:404)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
    ... 11 more

lib : Firebase RemoteConfig - DonManfred
lib ver : 2.52
B4A ver : 10.2 Beta
sdk :full update

manifest :
B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)


main :
B4X:
#AdditionalJar: com.google.firebase:firebase-core
#AdditionalJar: com.google.firebase:firebase-config


configuration:
jdk-11.0.1
android-30

 

DonManfred

Expert
Licensed User
Longtime User
can you write the full list of dependencies?
i´m not sure about what all is needed with the newest versions.

I tried to update Firebase Manifest snippet from Analytics snippet and the AAR that was generated by Android Studio running the Quickstart Config example.
But that did not work.
I´m not sure how to interpret the error i found in the unfiltered or what is missing :-(

This is the error using my manifestcode in the lib.


firebase.b4x_excluded (adapted from anylytics and added based on AS Project generated Manifest)
 
Upvote 0

SMOOTSARA

Active Member
Licensed User
Longtime User
Hello

Will this problem be solved?
Or publish an update without this library?

Thank you good friends
 
Upvote 0

SMOOTSARA

Active Member
Licensed User
Longtime User
Hi Erel and DonManfred
This library is practical and important
Do you have a plan to solve this problem?
Do you think I should reduce the SDK version to fix this error?
I can start app updates with a lower SDK version of the app.
Thank you for your cooperation.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…