Skip to content

App crash at startup #17

@Spike87

Description

@Spike87

I just included this repo in my app, and everything seems to work fine up to when I try to run the app. The app crashes instantly at startup as soon as I include any openCV related code. Here an example:

import org.opencv.core.Mat;
public class MainActivity extends AppCompatActivity {

    static {//is any of these actually needed?
        //System.loadLibrary("opencv_java3"); //needed to include OPENCV in the app
        //System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
        //System.loadLibrary();
    }

    // images management
//    Bitmap imageDadBMP  = null;
    Mat imageDadMat     = new Mat(); //un-commenting this line makes the app crash
//    Mat imageDadMatGray = new Mat();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }

}

I included the following line in my build.gradle (app) file:

implementation 'com.github.iamareebjamal:opencv-android:4.1.1-contrib'

and the following one in the build.gradle (project) file:

maven { url 'https://jitpack.io' }

NDK version: 21.1.6352462

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions