0

I've been struggling with this all day. I did the same thing that the repo says.

I ran:

npm install react-native-camera --save

react-native link react-native-camera

The output said that everything was linked correctly. But when I do:

react-native run-android

I get this error:

\MainApplication.java:6: error: package org.reactnative.camera does not exist import org.reactnative.camera.RNCameraPackage; ^

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.

That's not the entire error, I think that's just the most relevant part of it.

Any hand?

RottenCheese
  • 869
  • 2
  • 12
  • 18
  • Did you try to install it manually for android??? – Rajat Beck Mar 29 '18 at 20:53
  • Yes, I get this error: `Execution failed for task ':react-native-camera:processReleaseResources'. > Error: more than one library with package name 'com.google.android.gms.license' ` – RottenCheese Mar 29 '18 at 21:46

1 Answers1

0

Insert the following lines inside the dependencies block in android/app/build.gradle:

compile (project(':react-native-camera')) {
    exclude group: "com.google.android.gms"
    compile 'com.android.support:exifinterface:25.+'
    compile ('com.google.android.gms:play-services-vision:12.0.1') {
        force = true
    }
}

You may need to use different exifinterface versions, e.g. 27.+ instead of 25.+.

https://github.com/react-native-community/react-native-camera

4th step on manual installation on android.

alchi baucha
  • 930
  • 7
  • 17