0

I'am trying to debug native library used by MediaPlayer class:

import androidx.appcompat.app.AppCompatActivity;
import android.media.MediaPlayer;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        MediaPlayer mp = MediaPlayer.create(this, R.raw.lencia);
        mp.start();
   }
}

Debug type is (Dual Java + Native). But when I placed the breakpoint in

MediaPlayer.java at :

  private void startImpl() {
        baseStart();
        stayAwake(true);
        _start();
    }

Nothing happens. Could you please tell me how to start debugging the built-in c ++ libraries?

destrudos
  • 27
  • 6

2 Answers2

0

lldb knows nothing about Java or its debug information, so it can't translate from a source location in a Java source file to the implementation of that method in your code. You can use lldb to debug the Native side of your application, but not the Java side. You have to figure out where on the C side you need to break and start from there, you can't start from Java and step into C.

Jim Ingham
  • 25,260
  • 2
  • 55
  • 63
0

Android Studio does support debugging native code and Java code at the same time. This was answered in another post:

Debug native code in Android Studio

And the link to the Android Studio page that covers this "Dual" debugging is: https://developer.android.com/studio/debug

Greg Clayton
  • 271
  • 2
  • 3