ftylitak / qzxing

Qt/QML wrapper library for the ZXing library. 1D/2D barcode image processing library
Apache License 2.0
614 stars 338 forks source link

android.support has been replaced by androidx - change required for (mandatory) API level 30 #206

Open sebastiandiel opened 2 years ago

sebastiandiel commented 2 years ago

Google demands API level 30 for PlayStore, at least for new apps. Trying to step up, I've found a problem with qzxing/examples/QZXingLive/android/src/org/ftylitak/qzxing/Utilities.java and its imports

import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;

because android.support.v4 is discontinued and replaced by androidx.

Build was not successful.

For me, just replacing the imports this way seems to help:

//import android.support.v4.app.ActivityCompat;
//import android.support.v4.content.ContextCompat;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

Now it builds.

I'm not sure about compatibility the other way, perhaps there should be a API version check (if possible).