javah生成jni头文件时报错 Error: cannot access android.support...

时间:2021-10-06 04:56:02

javah生成jni头文件时报错:

Error: cannot access android.support.v7.app.AppCompatActivity

class file for android.support.v7.app.AppCompatActivity not found

Error: cannot access android.support.v4.app.FragmentActivity

class file for android.support.v4.app.FragmentActivity not found

Error: cannot access android.support.v4.app.BaseFragmentActivityHoneycomb

class file for android.support.v4.app.BaseFragmentActivityHoneycomb not found

Error: cannot access android.app.Activity

class file for android.app.Activity not found

可加入以下的jar文件解决

javah -d jni -classpath /Users/tom/Library/Android/sdk/platforms/android-23/android.jar:../..//build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/jars/libs/internal_impl-23.4.0.jar:../..//build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/jars/classes.jar:../..//build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/jars/classes.jar:../../build/intermediates/classes/debug com.milipictures.shenqi.AV.RecordAudioActivity