Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-91194

Android Service - Exception on startup

    XMLWordPrintable

Details

    • Android
    • 3466fc5b76a97eabc815a7406f01454e4ac0db4f (qt/qtbase/dev) aebbf928fac5462767b48a0e5907158071414cd9 (qt/qtbase/6.0) 3ebe798f2d1f62f1b7b20bac93e05ad40dbef21e (qt/qtbase/6.1) 76d3c7055bb1453de291d53e12ab4a015cd4997e (qt/tqtc-qtbase/5.15)

    Description

      With 5.12.5 everything works fine. But when we started to use 5.15.2 we get to exceptions when we start our service on Android:

      02-18 09:07:42.703 20819 20835 I QtCore  : Start
      02-18 09:07:42.723 20819 20835 I Qt      : qt started
      02-18 09:07:42.734 20819 20819 W System.err: java.lang.NoSuchMethodException: loadApplication [class android.app.Service, class java.lang.ClassLoader, class android.os.Bundle]
      02-18 09:07:42.734 20819 20819 W System.err: 	at java.lang.Class.getMethod(Class.java:1981)
      02-18 09:07:42.734 20819 20819 W System.err: 	at java.lang.Class.getDeclaredMethod(Class.java:1960)
      02-18 09:07:42.734 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtApplication.setQtContextDelegate(QtApplication.java:88)
      02-18 09:07:42.734 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtLoader.loadApplication(QtLoader.java:270)
      02-18 09:07:42.734 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:505)
      02-18 09:07:42.734 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtServiceLoader.onCreate(QtServiceLoader.java:63)
      02-18 09:07:42.734 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtService.onCreateHook(QtService.java:54)
      02-18 09:07:42.734 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtService.onCreate(QtService.java:60)
      02-18 09:07:42.734 20819 20819 W System.err: 	at com.governikus.ausweisapp2.AusweisApp2Service.onCreate(AusweisApp2Service.java:46)
      02-18 09:07:42.734 20819 20819 W System.err: 	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3255)
      02-18 09:07:42.734 20819 20819 W System.err: 	at android.app.ActivityThread.-wrap5(ActivityThread.java)
      02-18 09:07:42.734 20819 20819 W System.err: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1598)
      02-18 09:07:42.734 20819 20819 W System.err: 	at android.os.Handler.dispatchMessage(Handler.java:102)
      02-18 09:07:42.734 20819 20819 W System.err: 	at android.os.Looper.loop(Looper.java:241)
      02-18 09:07:42.734 20819 20819 W System.err: 	at android.app.ActivityThread.main(ActivityThread.java:6274)
      02-18 09:07:42.734 20819 20819 W System.err: 	at java.lang.reflect.Method.invoke(Native Method)
      02-18 09:07:42.734 20819 20819 W System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
      02-18 09:07:42.734 20819 20819 W System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
      02-18 09:07:42.735 20819 20819 W System.err: java.lang.NoSuchMethodException: startApplication []
      02-18 09:07:42.736 20819 20819 W System.err: 	at java.lang.Class.getMethod(Class.java:1981)
      02-18 09:07:42.736 20819 20819 W System.err: 	at java.lang.Class.getDeclaredMethod(Class.java:1960)
      02-18 09:07:42.736 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtApplication.setQtContextDelegate(QtApplication.java:88)
      02-18 09:07:42.736 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtLoader.loadApplication(QtLoader.java:270)
      02-18 09:07:42.736 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:505)
      02-18 09:07:42.736 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtServiceLoader.onCreate(QtServiceLoader.java:63)
      02-18 09:07:42.736 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtService.onCreateHook(QtService.java:54)
      02-18 09:07:42.736 20819 20819 W System.err: 	at org.qtproject.qt5.android.bindings.QtService.onCreate(QtService.java:60)
      02-18 09:07:42.736 20819 20819 W System.err: 	at com.governikus.ausweisapp2.AusweisApp2Service.onCreate(AusweisApp2Service.java:46)
      02-18 09:07:42.736 20819 20819 W System.err: 	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3255)
      02-18 09:07:42.736 20819 20819 W System.err: 	at android.app.ActivityThread.-wrap5(ActivityThread.java)
      02-18 09:07:42.736 20819 20819 W System.err: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1598)
      02-18 09:07:42.736 20819 20819 W System.err: 	at android.os.Handler.dispatchMessage(Handler.java:102)
      02-18 09:07:42.736 20819 20819 W System.err: 	at android.os.Looper.loop(Looper.java:241)
      02-18 09:07:42.736 20819 20819 W System.err: 	at android.app.ActivityThread.main(ActivityThread.java:6274)
      02-18 09:07:42.736 20819 20819 W System.err: 	at java.lang.reflect.Method.invoke(Native Method)
      02-18 09:07:42.736 20819 20819 W System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
      02-18 09:07:42.736 20819 20819 W System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
      

      Our service works fine, because this exception was there before. But a printing was introduced in https://codereview.qt-project.org/c/qt/qtbase/+/304155/3/src/android/java/src/org/qtproject/qt5/android/bindings/QtApplication.java.

      A provided a fix where I add the missing methods. Everything works fine with that, but I am not sure, if that is the right way. Because QtServiceDelegate has this methods, it looks like a missing link but I am not sure about the effect.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtandroidteam Qt Android Team
            larss Lars Schmertmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: