Android Question firebase messaging error

Discussion in 'Android Questions' started by Makumbi, Aug 18, 2019.

  1. Makumbi

    Makumbi Active Member Licensed User

    please help i get this error when i try to run my project please help

    Code:
    java.lang.RuntimeException: Unable to create service com.kccug.kabojjajuniorapp.starter: java.lang.RuntimeException: java.net.SocketException: Socket closed
        at android.app.ActivityThread.handleCreateService(ActivityThread.java:
    3544)
        at android.app.ActivityThread.access$
    1300(ActivityThread.java:199)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
    1666)
        at android.os.Handler.dispatchMessage(Handler.java:
    106)
        at android.os.Looper.loop(Looper.java:
    193)
        at android.app.ActivityThread.main(ActivityThread.java:
    6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:
    493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    858)
    Caused by: java.lang.RuntimeException: java.net.SocketException: 
    Socket closed
        at anywheresoftware.b4a.shell.Shell.virtualAssets(
    Shell.java:164)
        at anywheresoftware.b4a.shell.Shell.start(
    Shell.java:102)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    92)
        at com.kccug.kabojjajuniorapp.starter.onCreate(starter.java:
    34)
        at android.app.ActivityThread.handleCreateService(ActivityThread.java:
    3532)
        ... 
    8 more
    Caused by: java.net.SocketException: 
    Socket closed
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:
    119)
        at java.net.SocketInputStream.read(SocketInputStream.java:
    176)
        at java.net.SocketInputStream.read(SocketInputStream.java:
    144)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:
    248)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:
    288)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:
    347)
        at java.io.DataInputStream.readFully(DataInputStream.java:
    198)
        at java.io.DataInputStream.readInt(DataInputStream.java:
    389)
        at anywheresoftware.b4a.shell.Shell.virtualAssets(
    Shell.java:136)
        ... 
    12 more
     
  2. Brandsum

    Brandsum Active Member Licensed User

    This is happening in debug mode right?
     
  3. DonManfred

    DonManfred Expert Licensed User

    DO you really expect to get help with this (nearly ZERO) information you provide?
     
  4. Makumbi

    Makumbi Active Member Licensed User

    this is in my log file
     
  5. Brandsum

    Brandsum Active Member Licensed User

    Socket closed error happens if the IDE unexpectedly lost connection with the app in debug mode.
     
  6. Makumbi

    Makumbi Active Member Licensed User

    Code:
    Public Sub SubscribeToTopics
        
    'fm.SubscribeToTopic("general") 'you can subscribe to more topics
        'fm.SubscribeToTopic("No0781703474") 'you can subscribe to more topics
        
        cursor1 = Starter.SQL1.ExecQuery(
    "SELECT phone AS Phone,Sex FROM Register")
        
    If cursor1.RowCount > 0 Then
            
    '    For i = 0 To cursor1.RowCount - 1
            cursor1.Position =0
            
    Dim Phoneg As String
            Phoneg = cursor1.Getstring(
    "Phone")
            
    Log(Phoneg)
            fm.SubscribeToTopic(Phoneg) 
    'you can subscribe to more topics
            
            
    'Next
        End If
    End Sub
    the error comes at this code below
    Code:
    fm.SubscribeToTopic(Phoneg) 'you can
    that is when i try to SubscribeToTopic to my phone number the error is flagged
     
  7. Makumbi

    Makumbi Active Member Licensed User

    sorry for not submitting the entire log file but it is like this

    Code:
    *** Service (starter) Create ***
    ** 
    Service (starter) Start **
    ** 
    Activity (main) Create, isFirst = true **
    ** 
    Activity (main) Resume **
    Class 
    not found: b4a.example.b4xtable, trying: com.kccug.kabojjajuniorapp.b4xtable
    0
    Class 
    not found: b4a.example.b4xfloattextfield, trying: com.kccug.kabojjajuniorapp.b4xfloattextfield
    *** 
    Service (firebasemessaging) Create ***
    ** 
    Service (firebasemessaging) Start **
    *** 
    Service (httputils2service) Create ***
    ** 
    Service (httputils2service) Start **
    ** 
    Service (httputils2service) Start **
    0782911364
    java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/
    String;)Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in base.apk)
        at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
        at com.kccug.kabojjajuniorapp.firebasemessaging._subscribetotopics(firebasemessaging.java:
    305)
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.shell.Shell.runMethod(
    Shell.java:732)
        at anywheresoftware.b4a.shell.Shell.raiseEventImpl(
    Shell.java:348)
        at anywheresoftware.b4a.shell.Shell.raiseEvent(
    Shell.java:255)
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    144)
        at anywheresoftware.b4a.BA$
    2.run(BA.java:370)
        at android.os.Handler.handleCallback(Handler.java:
    873)
        at android.os.Handler.dispatchMessage(Handler.java:
    99)
        at android.os.Looper.loop(Looper.java:
    193)
        at android.app.ActivityThread.main(ActivityThread.java:
    6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:
    493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    858)
    java.lang.RuntimeException: java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/
    String;)Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in base.apk)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:175)
        at anywheresoftware.b4a.BA$
    2.run(BA.java:370)
        at android.os.Handler.handleCallback(Handler.java:
    873)
        at android.os.Handler.dispatchMessage(Handler.java:
    99)
        at android.os.Looper.loop(Looper.java:
    193)
        at android.app.ActivityThread.main(ActivityThread.java:
    6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:
    493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    858)
    Caused by: java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/
    String;)Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in base.apk)
        at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
        at com.kccug.kabojjajuniorapp.firebasemessaging._subscribetotopics(firebasemessaging.java:
    305)
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.shell.Shell.runMethod(
    Shell.java:732)
        at anywheresoftware.b4a.shell.Shell.raiseEventImpl(
    Shell.java:348)
        at anywheresoftware.b4a.shell.Shell.raiseEvent(
    Shell.java:255)
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    144)
        ... 
    8 more
    where 0782911364 is the phone number subscribed to
     
  8. DonManfred

    DonManfred Expert Licensed User

    Please post the path in B4A Sdk Manager and the path of android.jar under Tools - Configure Paths.
     
  9. Makumbi

    Makumbi Active Member Licensed User

    there it is thank you
     

    Attached Files:

  10. DonManfred

    DonManfred Expert Licensed User

    The paths are text. USE TEXT to post them.
    Additionally you posted just one path and i asked for two paths.

    Note that your additional library folder should NEVER be inside the programs folder as it is a restricted folder!
     
  11. Makumbi

    Makumbi Active Member Licensed User

    c
    can i just copy the entire libraries for B4a android to drive c where i can create a folder then paste everything there
     
  12. DonManfred

    DonManfred Expert Licensed User

    Start with answering all questions! If you just ignore them then don´t expect me to try further helping here.

    Additionally you should start a new thread for any new question.
     
    Last edited: Aug 18, 2019
  13. DonManfred

    DonManfred Expert Licensed User

    You can use AnyDesk and give me your Anydesc ID. I´ll connect to your pc and help you seting up the SDK correctly. I fear you did not setup it correctly.
     
  14. Makumbi

    Makumbi Active Member Licensed User

    that is my id 115 561 020
     
  15. DonManfred

    DonManfred Expert Licensed User

    i get no connection.
     
  16. Makumbi

    Makumbi Active Member Licensed User

    please try now i have i finished installed i d is still the same
     
  17. Makumbi

    Makumbi Active Member Licensed User

    it is done downloading please
     
  18. DonManfred

    DonManfred Expert Licensed User

    i have problems reconnecting. still trying....
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice