Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building React Native from source failed #25173

Closed
holmeshe opened this issue Jun 6, 2019 · 14 comments
Closed

Building React Native from source failed #25173

holmeshe opened this issue Jun 6, 2019 · 14 comments
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@holmeshe
Copy link

holmeshe commented Jun 6, 2019

  1. The following error is found in gradle sync phase:
ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
	is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
	Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-117 to override.

It could be fixed by adding the following two lines,

android.useAndroidX=true
android.enableJetifier=true

to gradle.properties of the app project

  1. Then comes to the second error,
06-06 17:59:17.698 26292-26336/com.fromsource E/dalvikvm: dlopen("/data/app-lib/com.fromsource-1/libjscexecutor.so") failed: dlopen failed: 
06-06 17:59:17.698 26292-26336/com.fromsource E/SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: 
06-06 17:59:17.698 26292-26336/com.fromsource W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/facebook/react/jscexecutor/JSCExecutor;
06-06 17:59:17.698 26292-26336/com.fromsource W/dalvikvm: threadid=18: thread exiting with uncaught exception (group=0x418ccc68)
06-06 17:59:17.708 26292-26336/com.fromsource E/AndroidRuntime: FATAL EXCEPTION: create_react_context
    Process: com.fromsource, PID: 26292
    java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: 
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
        at com.facebook.react.jscexecutor.JSCExecutor.<clinit>(JSCExecutor.java:19)
        at com.facebook.react.jscexecutor.JSCExecutorFactory.create(JSCExecutorFactory.java:29)
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:956)
        at java.lang.Thread.run(Thread.java:841)
06-06 17:59:17.768 26292-26292/com.fromsource W/linker: library "libmaliinstr.so" not found

Which can be fixed by removing the following line (271)

task packageReactNdkLibs(dependsOn: buildReactNdkLib, type: Copy) {
    from("$buildDir/react-ndk/all")
    into("$buildDir/react-ndk/exported")
    exclude("**/libjsc.so")  <-----------------------remove this line
}

in build.gradle of ReactAndroid project

React Native version: master
react-native-cli version: 2.0.1

Steps To Reproduce

  1. Create a React Native app using react-native-cli (version as indicated above)
  2. Follow the instructions from https://github.com/facebook/react-native/wiki/Building-from-source

Describe what you expected to happen (next):

  1. Add AndroidX related instructions to the https://github.com/facebook/react-native/wiki/Building-from-source
  2. Not sure why exclude("**/libjsc.so") is there. If it is not intentional (for another deployment path), then it is required to be removed.
@holmeshe holmeshe added the Bug label Jun 6, 2019
@nhunzaker
Copy link
Contributor

I hit this as well and was able to resolve the issue by following the instructions above.

Thanks @holmeshe! You saved me a lot of time!

@felansu
Copy link

felansu commented Jun 17, 2019

My errors after point 1.

I get:

> Task :lottie-react-native:compileDebugJavaWithJavac FAILED
/Users/ferrangonzalezalonso/cloq/orion/node_modules/lottie-react-native/src/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManager.java:8: error: package android.support.v4.view does not exist
import android.support.v4.view.ViewCompat;
                              ^

For resolve that see that

Next!

> Task :react-native-camera:compileGeneralDebugJavaWithJavac FAILED
/Users/ferrangonzalezalonso/cloq/orion/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraView.java:10: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;

Resolving...

@nguyenhose
Copy link

nguyenhose commented Jun 18, 2019

@felansu lol I got that react-native-camera too. wonder if upgrade to androidx is correct path or not


solved it:
yarn add react-native-device-info@2.1.2
clean and rebuild

@kelset
Copy link
Contributor

kelset commented Jun 18, 2019

cc @hramos

@felansu
Copy link

felansu commented Jun 18, 2019

Hi guys! I'm back,

@nguyenhose, thank you very much for helping,
it has not worked, I have returned to the initial state of the project to try to apply only your solution, which is to update the version of react-native-device-info to version 2.1.2.

I have done the command:
cd android / && ./gradlew clean && cd ..

and later:
react-native run android.

The result:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ': app: processDebugManifest'.
> Manifest merger failed: Attribute application @ appComponentFactory value = (android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml: 22: 18-91
         is also present at [androidx.core: core: 1.0.0] AndroidManifest.xml: 22: 18-86 value = (androidx.core.app.CoreComponentFactory).
         Suggestion: add 'tools: replace = "android: appComponentFactory"' to <application> element at AndroidManifest.xml: 7: 5-117 to override.

I go to:

/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/SurfaceViewPreview.java
/node_modules/lottie-react-native/src/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManager.java
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java

and rename:
import android.support.v4.view.ViewCompat;

to:
import androidx.core.view.ViewCompat;

Now!! The result is that:

> Task :react-native-camera:compileGeneralDebugJavaWithJavac FAILED
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraView.java:10: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
                                 ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:27: error: package android.support.annotation does not exist
import android.support.annotation.IntDef;
                                 ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:28: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:29: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:30: error: cannot find symbol
import android.support.v4.os.ParcelableCompat;
                            ^
  symbol:   class ParcelableCompat
  location: package android.support.v4.os
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:31: error: cannot find symbol
import android.support.v4.os.ParcelableCompatCreatorCallbacks;
                            ^
  symbol:   class ParcelableCompatCreatorCallbacks
  location: package android.support.v4.os
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/AspectRatio.java:21: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/AspectRatio.java:22: error: package android.support.v4.util does not exist
import android.support.v4.util.SparseArrayCompat;
                              ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Size.java:21: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/AspectRatio.java:29: error: cannot find symbol
    private final static SparseArrayCompat<SparseArrayCompat<AspectRatio>> sCache
                         ^
  symbol:   class SparseArrayCompat
  location: class AspectRatio
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/AspectRatio.java:29: error: cannot find symbol
    private final static SparseArrayCompat<SparseArrayCompat<AspectRatio>> sCache
                                           ^
  symbol:   class SparseArrayCompat
  location: class AspectRatio
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:9: error: package android.support.media does not exist
import android.support.media.ExifInterface;
                            ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/CameraViewManager.java:3: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:9: error: package android.support.media does not exist
import android.support.media.ExifInterface;
                            ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:282: error: cannot find symbol
  public static WritableMap getExifData(ExifInterface exifInterface) {
                                        ^
  symbol:   class ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:312: error: cannot find symbol
  public static void setExifData(ExifInterface exifInterface, WritableMap exifMap) {
                                 ^
  symbol:   class ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/BarCodeReadEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/BarCodeReadEvent.java:18: error: package Pools does not exist
  private static final Pools.SynchronizedPool<BarCodeReadEvent> EVENTS_POOL =
                            ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/PictureTakenEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/PictureTakenEvent.java:14: error: package Pools does not exist
  private static final Pools.SynchronizedPool<PictureTakenEvent> EVENTS_POOL = new Pools.SynchronizedPool<>(3);
                            ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/BarcodeDetectionErrorEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/BarcodeDetectionErrorEvent.java:13: error: package Pools does not exist
  private static final Pools.SynchronizedPool<BarcodeDetectionErrorEvent> EVENTS_POOL = new Pools.SynchronizedPool<>(3);
                            ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/BarcodesDetectedEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/BarcodesDetectedEvent.java:13: error: package Pools does not exist
  private static final Pools.SynchronizedPool<BarcodesDetectedEvent> EVENTS_POOL =
                            ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/PictureSavedEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/PictureSavedEvent.java:12: error: package Pools does not exist
    private static final Pools.SynchronizedPool<PictureSavedEvent> EVENTS_POOL = new Pools.SynchronizedPool<>(5);
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/CameraReadyEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/CameraReadyEvent.java:14: error: package Pools does not exist
  private static final Pools.SynchronizedPool<CameraReadyEvent> EVENTS_POOL = new Pools.SynchronizedPool<>(3);
                            ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/FaceDetectionErrorEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/FaceDetectionErrorEvent.java:12: error: package Pools does not exist
  private static final Pools.SynchronizedPool<FaceDetectionErrorEvent> EVENTS_POOL = new Pools.SynchronizedPool<>(3);
                            ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/CameraMountErrorEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/CameraMountErrorEvent.java:11: error: package Pools does not exist
  private static final Pools.SynchronizedPool<CameraMountErrorEvent> EVENTS_POOL = new Pools.SynchronizedPool<>(3);
                            ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/FacesDetectedEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/FacesDetectedEvent.java:13: error: package Pools does not exist
  private static final Pools.SynchronizedPool<FacesDetectedEvent> EVENTS_POOL =
                            ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/TextRecognizedEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/TextRecognizedEvent.java:16: error: package Pools does not exist
  private static final Pools.SynchronizedPool<TextRecognizedEvent> EVENTS_POOL =
                            ^
/node_modules/react-native-camera/android/src/main/java/com/lwansbrough/RCTCamera/MutableImage.java:6: error: package android.support.media does not exist
import android.support.media.ExifInterface;
                            ^
/node_modules/react-native-camera/android/src/main/java/com/lwansbrough/RCTCamera/MutableImage.java:229: error: cannot find symbol
    private void rewriteOrientation(ExifInterface exif) {
                                    ^
  symbol:   class ExifInterface
  location: class MutableImage
/node_modules/react-native-camera/android/src/main/java/com/lwansbrough/RCTCamera/MutableImage.java:233: error: cannot find symbol
    private void writeLocationExifData(ReadableMap options, ExifInterface exif) {
                                                            ^
  symbol:   class ExifInterface
  location: class MutableImage
/node_modules/react-native-camera/android/src/main/java/com/lwansbrough/RCTCamera/MutableImage.java:292: error: cannot find symbol
        public static void writeExifData(double latitude, double longitude, ExifInterface exif) throws IOException {
                                                                            ^
  symbol:   class ExifInterface
  location: class GPS
/node_modules/react-native-camera/android/src/main/java/com/lwansbrough/RCTCamera/RCTCameraViewManager.java:3: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:56: error: cannot find symbol
    @IntDef({FACING_BACK, FACING_FRONT})
     ^
  symbol:   class IntDef
  location: class CameraView
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:78: error: cannot find symbol
    @IntDef({FLASH_OFF, FLASH_ON, FLASH_TORCH, FLASH_AUTO, FLASH_RED_EYE})
     ^
  symbol:   class IntDef
  location: class CameraView
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera1.java:27: error: package android.support.v4.util does not exist
import android.support.v4.util.SparseArrayCompat;
                              ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera1.java:48: error: cannot find symbol
    private static final SparseArrayCompat<String> FLASH_MODES = new SparseArrayCompat<>();
                         ^
  symbol:   class SparseArrayCompat
  location: class Camera1
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera1.java:58: error: cannot find symbol
    private static final SparseArrayCompat<String> WB_MODES = new SparseArrayCompat<>();
                         ^
  symbol:   class SparseArrayCompat
  location: class Camera1
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/SizeMap.java:19: error: package android.support.v4.util does not exist
import android.support.v4.util.ArrayMap;
                              ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/SizeMap.java:30: error: cannot find symbol
    private final ArrayMap<AspectRatio, SortedSet<Size>> mRatios = new ArrayMap<>();
                  ^
  symbol:   class ArrayMap
  location: class SizeMap
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera2.java:40: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
/node_modules/react-native-camera/android/src/general/java/org/reactnative/facedetector/tasks/FileFaceDetectionAsyncTask.java:6: error: package android.support.media does not exist
import android.support.media.ExifInterface;
                            ^
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:132: error: cannot find symbol
    @NonNull
     ^
  symbol:   class NonNull
  location: class CameraView
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:324: error: cannot find symbol
    public void addCallback(@NonNull Callback callback) {
                             ^
  symbol:   class NonNull
  location: class CameraView
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:334: error: cannot find symbol
    public void removeCallback(@NonNull Callback callback) {
                                ^
  symbol:   class NonNull
  location: class CameraView
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:399: error: cannot find symbol
    public void setAspectRatio(@NonNull AspectRatio ratio) {
                                ^
  symbol:   class NonNull
  location: class CameraView
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:410: error: cannot find symbol
    @Nullable
     ^
  symbol:   class Nullable
  location: class CameraView
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:420: error: cannot find symbol
    public SortedSet<Size> getAvailablePictureSizes(@NonNull AspectRatio ratio) {
                                                     ^
  symbol:   class NonNull
  location: class CameraView
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:429: error: cannot find symbol
    public void setPictureSize(@NonNull Size size) {
                                ^
  symbol:   class NonNull
  location: class CameraView
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/AspectRatio.java:136: error: cannot find symbol
    public int compareTo(@NonNull AspectRatio another) {
                          ^
  symbol:   class NonNull
  location: class AspectRatio
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Size.java:91: error: cannot find symbol
    public int compareTo(@NonNull Size another) {
                          ^
  symbol:   class NonNull
  location: class Size
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/CameraViewManager.java:62: error: cannot find symbol
  @Nullable
   ^
  symbol:   class Nullable
  location: class CameraViewManager
/node_modules/react-native-camera/android/src/main/java/com/lwansbrough/RCTCamera/RCTCameraViewManager.java:40: error: cannot find symbol
    public void receiveCommand(RCTCameraView view, int commandType, @Nullable ReadableArray args) {
                                                                     ^
  symbol:   class Nullable
  location: class RCTCameraViewManager
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera2.java:1335: error: cannot find symbol
        public void onCaptureProgressed(@NonNull CameraCaptureSession session,
                                         ^
  symbol:   class NonNull
  location: class PictureCaptureCallback
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera2.java:1336: error: cannot find symbol
                @NonNull CaptureRequest request, @NonNull CaptureResult partialResult) {
                 ^
  symbol:   class NonNull
  location: class PictureCaptureCallback
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera2.java:1336: error: cannot find symbol
                @NonNull CaptureRequest request, @NonNull CaptureResult partialResult) {
                                                  ^
  symbol:   class NonNull
  location: class PictureCaptureCallback
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera2.java:1341: error: cannot find symbol
        public void onCaptureCompleted(@NonNull CameraCaptureSession session,
                                        ^
  symbol:   class NonNull
  location: class PictureCaptureCallback
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera2.java:1342: error: cannot find symbol
                @NonNull CaptureRequest request, @NonNull TotalCaptureResult result) {
                 ^
  symbol:   class NonNull
  location: class PictureCaptureCallback
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera2.java:1342: error: cannot find symbol
                @NonNull CaptureRequest request, @NonNull TotalCaptureResult result) {
                                                  ^
  symbol:   class NonNull
  location: class PictureCaptureCallback
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera2.java:1346: error: cannot find symbol
        private void process(@NonNull CaptureResult result) {
                              ^
  symbol:   class NonNull
  location: class PictureCaptureCallback
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:703: error: cannot find symbol
                = ParcelableCompat.newCreator(new ParcelableCompatCreatorCallbacks<SavedState>() {
                                                  ^
  symbol:   class ParcelableCompatCreatorCallbacks
  location: class SavedState
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/CameraView.java:703: error: cannot find symbol
                = ParcelableCompat.newCreator(new ParcelableCompatCreatorCallbacks<SavedState>() {
                  ^
  symbol:   variable ParcelableCompat
  location: class SavedState
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraView.java:515: error: cannot find symbol
      int result = ContextCompat.checkSelfPermission(getContext(), Manifest.permission.CAMERA);
                   ^
  symbol:   variable ContextCompat
  location: class RNCameraView
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/AspectRatio.java:30: error: cannot find symbol
            = new SparseArrayCompat<>(16);
                  ^
  symbol:   class SparseArrayCompat
  location: class AspectRatio
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/AspectRatio.java:47: error: cannot find symbol
        SparseArrayCompat<AspectRatio> arrayX = sCache.get(x);
        ^
  symbol:   class SparseArrayCompat
  location: class AspectRatio
/node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/AspectRatio.java:50: error: cannot find symbol
            arrayX = new SparseArrayCompat<>();
                         ^
  symbol:   class SparseArrayCompat
  location: class AspectRatio
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:100: error: cannot find symbol
                ExifInterface exifInterface = new ExifInterface(inputStream);
                ^
  symbol:   class ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:100: error: cannot find symbol
                ExifInterface exifInterface = new ExifInterface(inputStream);
                                                  ^
  symbol:   class ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:102: error: cannot find symbol
                int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION,
                                                                ^
  symbol:   variable ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:103: error: cannot find symbol
                        ExifInterface.ORIENTATION_UNDEFINED);
                        ^
  symbol:   variable ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:108: error: cannot find symbol
                        && orientation != ExifInterface.ORIENTATION_UNDEFINED;
                                          ^
  symbol:   variable ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:137: error: cannot find symbol
                        fileExifData.putInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
                                            ^
  symbol:   variable ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:137: error: cannot find symbol
                        fileExifData.putInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
                                                                           ^
  symbol:   variable ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:159: error: cannot find symbol
                    ExifInterface fileExifInterface = new ExifInterface(filePath);
                    ^
  symbol:   class ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:159: error: cannot find symbol
                    ExifInterface fileExifInterface = new ExifInterface(filePath);
                                                          ^
  symbol:   class ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:226: error: cannot find symbol
        case ExifInterface.ORIENTATION_ROTATE_90:
             ^
  symbol:   variable ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:229: error: cannot find symbol
        case ExifInterface.ORIENTATION_ROTATE_180:
             ^
  symbol:   variable ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/tasks/ResolveTakenPictureAsyncTask.java:232: error: cannot find symbol
        case ExifInterface.ORIENTATION_ROTATE_270:
             ^
  symbol:   variable ExifInterface
  location: class ResolveTakenPictureAsyncTask
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:29: error: cannot find symbol
      {"string", ExifInterface.TAG_ARTIST},
                 ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:30: error: cannot find symbol
      {"int", ExifInterface.TAG_BITS_PER_SAMPLE},
              ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:31: error: cannot find symbol
      {"int", ExifInterface.TAG_COMPRESSION},
              ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:32: error: cannot find symbol
      {"string", ExifInterface.TAG_COPYRIGHT},
                 ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:33: error: cannot find symbol
      {"string", ExifInterface.TAG_DATETIME},
                 ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:34: error: cannot find symbol
      {"string", ExifInterface.TAG_IMAGE_DESCRIPTION},
                 ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:35: error: cannot find symbol
      {"int", ExifInterface.TAG_IMAGE_LENGTH},
              ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:36: error: cannot find symbol
      {"int", ExifInterface.TAG_IMAGE_WIDTH},
              ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:37: error: cannot find symbol
      {"int", ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT},
              ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:38: error: cannot find symbol
      {"int", ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH},
              ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:39: error: cannot find symbol
      {"string", ExifInterface.TAG_MAKE},
                 ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:40: error: cannot find symbol
      {"string", ExifInterface.TAG_MODEL},
                 ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:41: error: cannot find symbol
      {"int", ExifInterface.TAG_ORIENTATION},
              ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:42: error: cannot find symbol
      {"int", ExifInterface.TAG_PHOTOMETRIC_INTERPRETATION},
              ^
  symbol:   variable ExifInterface
  location: class RNCameraViewHelper
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /node_modules/react-native-camera/android/src/main/java/com/google/android/cameraview/Camera2.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
100 errors

FAILURE: Build failed with an exception.

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

Ok, i need rename all packages:

import android.support.v4.content.ContextCompat;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.os.ParcelableCompat;
import android.support.v4.os.ParcelableCompatCreatorCallbacks;
import android.support.v4.util.SparseArrayCompat;
import android.support.media.ExifInterface;
import android.support.v4.util.Pools;
import android.support.v4.util.ArrayMap;

Explained here

Ok, after replace all files (third party too), now 'work'...

Installed on 1 device.
BUILD SUCCESSFUL in 24s

What is the problem? The packages don't support androidx?

@songoten28
Copy link

songoten28 commented Jun 19, 2019

@felansu
Change to
ext{
googlePlayServicesVersion = "15.0.1"
firebaseVersion = "17.6.0"
}

upgrade your dependence to
"react-native-camera": "^1.13.1"

and ref to #25301

@paruckerr
Copy link

@felansu you renamed all this packages?

import android.support.v4.content.ContextCompat;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.os.ParcelableCompat;
import android.support.v4.os.ParcelableCompatCreatorCallbacks;
import android.support.v4.util.SparseArrayCompat;
import android.support.media.ExifInterface;
import android.support.v4.util.Pools;
import android.support.v4.util.ArrayMap;

I face the same issue, but where did you change?

android/app/build.gradle? MainApplication.java?

@felansu
Copy link

felansu commented Jun 19, 2019

@paruckerr you need change all that packages in node_modules.
I replace manually with intellij idea.

@paruckerr
Copy link

@felansu so, I change all packages...

But now when App is build, this crash happen..

adb logcat

AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.FileProvider" on path: DexPathList[[zip file "/data/app/my-app-2/base.apk"],nativeLibraryDirectories=[/data/app/my-app-2/lib/arm, /data/app/my-app-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]

This was generated after BUILD SUCCESSFUL

I remove all those files...
image

But after run-android this was regenerate...

Any ideas?

@paruckerr
Copy link

I found the problem...

react-native-image-crop-picker > manifests > AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.reactnative.ivpusic.imagepicker">

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application>

        <provider
            android:name="androidx.core.content.FileProvider" //Change here
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>

        <activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
    </application>

</manifest>

@felansu
Copy link

felansu commented Jun 20, 2019

@songoten28

"react-native-camera": "^1.13.1"

I have "react-native-camera": "^2.9.0"

@songoten28
Copy link

@felansu You can find solution here
#25307 (comment)

@stale
Copy link

stale bot commented Sep 19, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 19, 2019
@stale
Copy link

stale bot commented Sep 26, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Sep 26, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Sep 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

7 participants