Android Question Firebase Notifications

fishwolf

Well-Known Member
Licensed User
Longtime User
i have follow the tutorial, but i have this error on startup

i have define a application on firebase console (firebase.test)

B4X:
PackageAdded: package:firebase.test
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (firebasemessaging) Create **
Error occurred on line: 11 (FirebaseMessaging)
java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist. 
    at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
    at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
    at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
    at com.google.firebase.messaging.FirebaseMessaging.getInstance(Unknown Source)
    at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.Initialize(FirebaseNotificationsService.java:71)
    at firebase.test.firebasemessaging._service_create(firebasemessaging.java:160)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:703)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
    at firebase.test.firebasemessaging.onCreate(firebasemessaging.java:54)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2414)
    at android.app.ActivityThread.access$1700(ActivityThread.java:140)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1319)
 

fishwolf

Well-Known Member
Licensed User
Longtime User
yes
i install google repository
subscribe firebase services and define a example app
is have download and copy into project/Files folder the google-services.json
add into manifest "Google Play Services Base" and "Firebase Notifications" entry

in other example for analitics i haven't error
 
Upvote 0

chefe82

Member
Licensed User
Longtime User
3. Download google-services.json and put it in the projects folder (folder of the b4a file).

Project folder not Files folder
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
resolved,

i hadn't set the firebase section into manifest (only google paly and notification section)
 
Upvote 0
Top