Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-20943

Adding JNIEXPORT function kills Android service under debugger

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • Qt Creator 4.7.0
    • Debugger
    • None
    • Android, Windows

    Description

      I'm trying to call c++ function from Java.

      For this I added some function like this:

      extern "C" JNIEXPORT void JNICALL Java_org_test_app_MyActivity_onTest(
              JNIEnv *env,
              jobject obj,
              jstring url)
      {
          Q_ASSERT(env);
          QString myurl = QString::fromUtf8(
                      env->GetStringUTFChars(url, nullptr));
          qDebug() << "got url: " << myurl;
      }
      

      Now, when I start my app under the debugger, activity part starts OK but service part starts and terminates a bit later (my activity starts the service).

      If I launch app without debugger - all works fine and c++ method is called (I see the debug output in the log).

      I've tried removing all from Java code related to calling this c++ function - did not help. If I remove this function from c++ - starts to work under debugger.

      Attachments

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

        Activity

          People

            vikas Vikas Pachdha
            alervd Alexander Dyagilev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes