Javah still won't find class files in OSX / Android Studio

前端 未结 1 1753
别那么骄傲
别那么骄傲 2021-01-16 03:46

Having referred to --> Javah error while using it in JNI

...and --> android - javah doesn't find my class

...I still can\'t get javah to wor

相关标签:
1条回答
  • 2021-01-16 03:58

    Got it! It needs the compiled class, not the source. Also, the class folder - ./build/intermediates/classes/debug is hidden from the project in Android Studio.

    This is the line that finally worked for me. From my module's root folder (/Users/HKS/Code/MusicPlayer-Android/dspLibrary/):

    javah -classpath /Applications/Android\ Studio.app/sdk/platforms/android-16/android.jar:./build/intermediates/classes/debug -jni -d src/main/jni -force com.company.audio.LibDSP
    

    Note the -d flag is the output folder, and -force ensures it overwrites any existing files.

    0 讨论(0)
提交回复
热议问题