Runtime problem with Android libraries tutorial

Sysprogs forums Forums VisualGDB Runtime problem with Android libraries tutorial

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #688
    hpetschko
    Participant

    Hi,

    please see “Build problem with Android libraries tutorial” for the story so far.
    Though I was able to build the application and the library, I am not able to run them.
    I have tried this on a virtual 7″ WSVGA device with Android 4.2.2 and the standard settings given by the AVD Manager and on a physical 8″ device (Acer Iconia, Android 4.2.2).
    Both are telling me “Unfortunately, AndroidProject1 has stopped”. The GDBLog is attached.

    The project is the same as in the above mentioned topic, only the platform version has been changed to 4.2.2.

    Thanks in advance

    H

    #2804
    ket
    Participant

    Hi,

    Look in the LogCat for any errors. When the app is killed it is usually Android itself killing it due to some problems related to the Java code or app setup.

    You can display the LogCat window without a current debug session from Debug->Windows->Android LogCat.

    #2805
    hpetschko
    Participant

    Hi,

    it seems like the library is not deployed. Please find attached the log output from the LogCat window.
    The project is the one from “Build problem with Android libraries tutorial” as mentioned in my first post.

    Many thanks

    H

    #2807
    ket
    Participant

    Hi,

    The library is deployed inside the apk file and it is put there during build. Check inside the apk file for the library with any zip program, it should be in the directory matching your abi. If it is not there try rebuilding the solution and watch for any errors or warnings, then check the apk again. The library is supposed to be first copied into the libs folder and then into the apk in bin.

    #2808
    hpetschko
    Participant

    Hi,

    the library file is there.
    Could you please check whether the tutorial is still working as inteded.
    In the thread “Build problem with Android libraries tutorial” you told me that there have been changes in the Android build system (you also sent me a fix), maybe this also has an impact on the runtime behaviour.
    If necessary I will send the project.

    Thanks a lot

    H

    #2809
    ket
    Participant

    Hi,

    Yes, we can also replicate the issue. We are still looking into it deeper.
    You could switch to using the static version of the library, then launching and debugging will work as there will be no additional library to load. The app will start without crashing using the shared version of the library if you add a System.loadLibrary(“AndroidLibrary1-shared”) call into the app’s Java code. This call should be before the System.loadLibrary(“AndroidProject20”) call. In our tests this was not enough to enable setting breakpoints in the AndroidLibrary1-shared library’s code, we are still looking into enabling that. If you could let us know which exact versions of Android NDK, Android SDK Tools, Android SDK Build-tools (listed in the Android SDK Manager), ANT and Java JDK you are using, it could help us narrow down the issue more. Also knowing the app’s target Android platform and the Android device’s platform would be helpful.

    #2806
    hpetschko
    Participant

    Hi,

    thanks for the effort so far!
    I have attached a screen shot of the SDK Manager. The ANT version is 1.9.2, JDK is 1.7.0_45.
    The device is an Acer Iconia Model A1-810 running Android 4.2.2. This is also the target platform of the project.
    Hope that helps.

    H

    #2810
    ket
    Participant

    Hi,

    We have looked further into this. To enable debugging also in the dependent library, change the project’s (not the library’s) Android.mk file, the shared-prebuilt’s LOCAL_SRC_FILES should not contain the libs subfolder, but obj/local as in the case of static-prebuilt. Then the symbols will be properly loaded.

    #2811
    hpetschko
    Participant

    Dear support team,

    we are nearly there.
    By loading the library ‘manually’ the application starts without problems.
    However breakpoints are still not hit, neither in the project’s c file nor in the one of the library.
    I have attached the project.

    Thank you very much!

    H

    #2812
    support
    Keymaster

    Hi,

    We tried your project, for us the breakpoints were set both in the project and library files. Have you tried rebuilding the project?

    If you still experience issues with breakpoints, try the Android breakpoint issues tutorial for hints or submit us a full gdb log.

    #2813
    hpetschko
    Participant

    Hi,

    uninstalling the app on the device did solve it.
    Now the breakpoints are hit.

    Thanks a lot

    H

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.