My projectPath : C:\Users\harsh.bhavsar\Downloads\Android-NDK-Sample-Test-master\NDKexe
SDK path android jar path: D:\ANDROID-SDK\Sdk\platforms\android-23
Java is set in Environment path. I didn't make c file right now as show in this tutorial First Auto generating headerfile and i got errors. I didnt find classes that shows in error. Mainly
Here is this command i run in project terminal
C:\Users\harsh.bhavsar\Downloads\Android-NDK-Sample-Test-master\NDKexe>javah C:\Users\harsh.bhavsar\Downloads\Android-NDK-Sample-Test- master\NDKexe\app\src\main\java\com\example\harshbhavsar\ndkexe ../../bin/classes;D:\ANDROID-SDK\Sdk\platforms\android-23 - o HelloJNI.h -o C:\Users\harsh.bhavsar\Downloads\Android-NDK-Sample-Test-master\NDKexe\app\build\intermediates\classes\debug\com\example\harshbhavsar\ndkexe\com.example.harshbhavsar.ndkexe.MainActivity
Can any one explain this stuff Step by step.
Exception in thread main java.IllegalArgumentException: not a valid class name
at com.sun.tools.javac.api.JavacTool.getTask<JavacTool.java:177>
at com.sun.tools.javac.api.JavacTool.getTask<JavacTool.java:68>
at com.sun.tools.javah.api.JavachTask.run<JavahTask.java:509>
at com.sun.tools.javah.api.JavachTask.run<JavahTask.java:335>
at com.sun.tools.javah.Main.main<Main.java:46>
This is my MainActivity
public class MainActivity extends AppCompatActivity {
static {
System.loadLibrary("myjni");
}
public native String getMessage();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Android.mk file
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := myjni
LOCAL_SRC_FILES := HelloJNI.c
include $(BUILD_SHARED_LIBRARY)