inaturalist/react-native-inat-camera

Add support for AndroidX

albullington opened this issue · 0 comments

The new versions of React Native (0.60.x) require support for AndroidX, which means we'll need to support AndroidX in this library as well. See details here.

Currently if I try to upgrade, I get this error message:

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: /Users/amanda/Desktop/Seek/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/amanda/Desktop/Seek/node_modules/react-native-fs/android/src/main/java/com/rnfs/RNFSManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/amanda/Desktop/Seek/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:13: error: package androidx.exifinterface.media does not exist
import androidx.exifinterface.media.ExifInterface;
                                   ^
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/ui/Camera2BasicFragment.java:34: error: cannot find symbol
import androidx.legacy.app.FragmentCompat;
                          ^
  symbol:   class FragmentCompat
  location: package androidx.legacy.app
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/ui/Camera2BasicFragment.java:74: error: package FragmentCompat does not exist
        implements FragmentCompat.OnRequestPermissionsResultCallback, OnTouchListener {
                                 ^
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:322: error: cannot find symbol
            ExifInterface exif = new ExifInterface(path);
            ^
  symbol:   class ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:322: error: cannot find symbol
            ExifInterface exif = new ExifInterface(path);
                                     ^
  symbol:   class ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:333: error: cannot find symbol
                    exif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_NORMAL));
                                      ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:333: error: cannot find symbol
                    exif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_NORMAL));
                                                                                    ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:336: error: cannot find symbol
                    exif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_ROTATE_90));
                                      ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:336: error: cannot find symbol
                    exif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_ROTATE_90));
                                                                                    ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:339: error: cannot find symbol
                    exif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_ROTATE_180));
                                      ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:339: error: cannot find symbol
                    exif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_ROTATE_180));
                                                                                    ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:342: error: cannot find symbol
                    exif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_ROTATE_270));
                                      ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:342: error: cannot find symbol
                    exif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_ROTATE_270));
                                                                                    ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:359: error: cannot find symbol
                exif.setAttribute(ExifInterface.TAG_GPS_LATITUDE, GPSEncoder.convert(latitude));
                                  ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:360: error: cannot find symbol
                exif.setAttribute(ExifInterface.TAG_GPS_LATITUDE_REF, GPSEncoder.latitudeRef(latitude));
                                  ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:361: error: cannot find symbol
                exif.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, GPSEncoder.convert(longitude));
                                  ^
  symbol:   variable ExifInterface
  location: class INatCameraView
/Users/amanda/Desktop/Seek/node_modules/react-native-inat-camera/android/src/main/java/org/inaturalist/inatcamera/nativecamera/INatCameraView.java:362: error: cannot find symbol
                exif.setAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF, GPSEncoder.longitudeRef(longitude));
                                  ^
  symbol:   variable ExifInterface
  location: class INatCameraView
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
17 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-inat-camera:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

    at checkExecSyncError (child_process.js:602:13)
    at execFileSync (child_process.js:622:13)
    at runOnAllDevices (/Users/amanda/Desktop/Seek/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:74:39)
    at buildAndRun (/Users/amanda/Desktop/Seek/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
    at then.result (/Users/amanda/Desktop/Seek/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)