Итак, я пытаюсь сгенерировать заголовочные файлы, используя 'javac', так как 'javah' устарел с java8.
javac "D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java"
-h "D:\Android Projects\NativeOpenCV"
Выше приведен код, который я использовал, где сначала Параметр - это мой источник, а второй параметр - мой пункт назначения, где будет сохранен файл заголовка. Но я получаю ошибки. В основном он не распознает ничего, что я написал в моем файле mainactivity.
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:3: error: package androidx.appcompat.app does not exist
import androidx.appcompat.app.AppCompatActivity;
^
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:5: error: package android.os does not exist
import android.os.Bundle;
^
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:6: error: package android.util does not exist
import android.util.Log;
^
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:7: error: package org.opencv.android does not exist
import org.opencv.android.OpenCVLoader;
^
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:8: error: package org.opencv.core does not exist
import org.opencv.core.Mat;
^
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:11: error: cannot find symbol
public class MainActivity extends AppCompatActivity {
^
symbol: class AppCompatActivity
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:14: error: cannot find symbol
protected void onCreate(Bundle savedInstanceState) {
^
symbol: class Bundle
location: class MainActivity
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:23: error: cannot find symbol
public static ArrayList<float[]> processMat(Mat mat, float threshold) {
^
symbol: class Mat
location: class MainActivity
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:13: error: method does not override or implement a method from a supertype
@Override
^
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:15: error: cannot find symbol
super.onCreate(savedInstanceState);
^
symbol: variable super
location: class MainActivity
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:16: error: package R does not exist
setContentView(R.layout.activity_main);
^
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:17: error: cannot find symbol
if (!OpenCVLoader.initDebug()) {
^
symbol: variable OpenCVLoader
location: class MainActivity
D:\Android Projects\NativeOpenCV\app\src\main\java\com\example\nativeopencv\MainActivity.java:18: error: cannot find symbol
Log.d("Error", "Unable to load OpenCV");
^
symbol: variable Log
location: class MainActivity
13 errors