OpenCV for Android: Illegal Link

I use OpenCVfor my project and everything works fine except DescriptorExtractor.java. This gives me the following errors every day:

/opencv/src/org/opencv/features2d/DescriptorExtractor.java
Error:(26, 29) error: illegal forward reference
Error:(27, 29) error: illegal forward reference
Error:(28, 28) error: illegal forward reference
Error:(29, 30) error: illegal forward reference
Error:(30, 30) error: illegal forward reference
Error:(31, 30) error: illegal forward reference
Error:(32, 30) error: illegal forward reference

The file initially looks like this:

public class DescriptorExtractor {

    public static final int
            SIFT = 1,
            SURF = 2,
            ORB = 3,
            BRIEF = 4,
            BRISK = 5,
            FREAK = 6,
            AKAZE = 7,
            OPPONENT_SIFT = OPPONENTEXTRACTOR + SIFT,
            OPPONENT_SURF = OPPONENTEXTRACTOR + SURF,
            OPPONENT_ORB = OPPONENTEXTRACTOR + ORB,
            OPPONENT_BRIEF = OPPONENTEXTRACTOR + BRIEF,
            OPPONENT_BRISK = OPPONENTEXTRACTOR + BRISK,
            OPPONENT_FREAK = OPPONENTEXTRACTOR + FREAK,
            OPPONENT_AKAZE = OPPONENTEXTRACTOR + AKAZE;
    private static final int
            OPPONENTEXTRACTOR = 1000;
    protected final long nativeObj;

Every day, I transfer the deviation OPPONENTEXTRACTORto the top of the class, and the problem disappears. But the next day, the class returns to the original. There is a comment at the top of the class

//
// This file is auto-generated. Please don't modify it!
//

What should I do? How to prevent this?

UPDATE:

I am using OpenCV for Android 3.0 and Java 7.80

+4
source share

Source: https://habr.com/ru/post/1611057/


All Articles