Kivy Buildozer: .so lib files missing debug symbols

Joshua Harwood picture Joshua Harwood · Mar 20, 2018 · Viewed 7.8k times · Source

.so lib files missing debug symbols

So I tried getting my bin/debug.apk to work in the Buildozer VM, but there was a problem with loading adb and attaching my Android device via USB, so I exported my bin/debug.apk to my desktop to debug it in Android Studio. However, in its first steps, it throws an error that asks me to replace the .so libraries with identical ones that have debug symbols.

.so lib files missing debug symbols

Are these stashed anywhere in the Buildozer VM during the buildozer android debug phase?

Is there a way to either get the libs with the symbols or work around not having them on either Android Studio or the Buildozer VM?

Answer

Serge Stroobandt picture Serge Stroobandt · Jan 1, 2019

Attach native debug symbols

If your APK includes native libraries (.so files) that do not include debug symbols, the IDE shows you a warning in the Messages window. You cannot debug the APK’s native code or use breakpoints without attaching debuggable native libraries.

To attach debuggable native libraries, proceed as follows:

  1. If you have not already done so, make sure to download the NDK and tools.
  2. Under the cpp directory in the Project window (visible only if you have selected the Android view, as shown in below figure), double-click a native library file that doesn't include debug symbols. The editor shows a table of all the ABIs your APK supports.
  3. Click Add at the top right corner of the editor window.
  4. Navigate to the directory that includes the debuggable native libraries you want to attach and click OK.

If the APK and debuggable native libraries were built using a different workstation, you need to also specify paths to local debug symbols by following these steps:

  1. Add local paths to missing debug symbols by editing the field under the Local Paths column in the Path Mappings section of the editor window, as shown in below figure. In most cases, you need only provide the path to a root folder, and Android Studio automatically inspects subdirectories to map additional sources. The IDE also automatically maps paths to a remote NDK to your local NDK download.
  2. Click Apply Changes in the Path Mappings section of the editor window.

Providing paths to local debug symbols.

You should now see the native source files in the Project window. Open those native files to add breakpoints and debug your app as you normally would. You can also remove the mappings by clicking Clear in the Path Mappings section of the editor window .

Known issue: When attaching debug symbols to an APK, both the APK and debuggable .so files must be built using the same workstation or build server.

Source