Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native Debug Android Studio

There was such an error when I run Native debugging through Genymotion.

Starting LLDB server: run-as org.cocos2dx.cpp_empty_test 
  /data/data/org.cocos2dx.cpp_empty_test/lldb/bin/start_lldb_server.sh 
  /data/data/org.cocos2dx.cpp_empty_test/lldb 
  /data/data/org.cocos2dx.cpp_empty_test/lldb/tmp/platform.port1442313534865 
  "lldb process:gdb-remote packets"
Now Launching Native Debug Session
Attention! No symbol directories found - please check your native debug configuration
Failed to attach native debugger: Invalid URL: adb://[169.254.67.102:5555]:46216
Invalid URL: adb://[169.254.67.102:5555]:46216
Process finished with exit code 0
like image 435
Влад Новосельцев Avatar asked Sep 15 '15 10:09

Влад Новосельцев


3 Answers

I encounter the same question, and I got the solution to solve it. But I'm not sure weather the solution is good for you. My solution is: Add the so path in your debug configuration. 1. Open the 'Run/Debug Configurations' dialog; 2. Click 'Debugger' Tab; 3. Add the 'Symbol Directories' with your so path.

My configuration as followenter image description here:

like image 67
Jack.Xiao Avatar answered Oct 23 '22 22:10

Jack.Xiao


you can try this:

1.in app/build.gradle:

at dependencies label:

releaseCompile project(path: ':youModuleName', configuration: 'release')
debugCompile project(path: ':youModuleName', configuration: 'debug')

2.in youModule/build.gradle:

at android label:

publishNonDefault true

demo:

https://github.com/sunalong/JNIDemo

like image 29
sunalong Avatar answered Oct 23 '22 21:10

sunalong


If you've followed all the steps here http://www.akaita.com/post/android-native-library-module-debug/ then you might also be suffering from a bug which is still in Android Studio 2.3.3 which is that the project's IML file gets out of sync with the gradle scripts and gets stuck in the release variant. See the accepted answer on this SO question: Debug a dynamically loaded native library in Android Studio?.

To quote that answer: "t turns out this is due to an old bug in AS. Apparently in the past the "SELECTED_BUILD_VARIANT" in the "native-android-gradle" section in the IML file could become out of step with the actual selected flavour."

To fix this issue, shut down Android Studio and open the IML file for the module that's building the native library (in the case of a single module app, just the app's IML file), and look for "native-android-gradle". For me this had become stuck as the release variant. Manually changing this and restarting got my symbols back.

like image 41
Crno Srce Avatar answered Oct 23 '22 22:10

Crno Srce