0

All the day I tried to build my project after linking react-native-camera. I think the issue is coming from the dependencies and google-play-service but I am not sure.

I tried many other configurations even if the build error is different, it's impossible to me to build ...

Last error I had was :

Android dependency 'com.google.android.gms:play-services-base' has different version for the compile (11.8.0) and runtime (12.0.1) classpath. You should manually set the same version via DependencyResolution

These are dependencies I got :

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation project(':tipsi-stripe')
    implementation "com.facebook.react:react-native:+"
    implementation project(':react-native-maps')
    implementation project(':react-native-camera')
    implementation 'com.google.firebase:firebase-core:10.0.1'
    implementation "com.android.support:appcompat-v7:23.0.1"
    implementation 'com.google.android.gms:play-services-base:10.0.1'
    implementation 'com.google.android.gms:play-services-maps:10.0.1'
}
eQuinox
  • 201
  • 3
  • 8

2 Answers2

0

This was discussed in this github forum and the provided solution was to use compile 'com.google.android.gms:play-services-vision:11.8.0' inside your dependency:

dependencies {
  compile 'com.facebook.react:react-native:+'
  compile "com.google.zxing:core:3.2.1"
  compile "com.drewnoakes:metadata-extractor:2.9.1"
  compile 'com.google.android.gms:play-services-vision:11.8.0'
  compile "com.android.support:exifinterface:+"

  compile 'com.github.react-native-community:cameraview:cc47bb28ed2fc54a8c56a4ce9ce53edd1f0af3a5'
}
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
0

Just follow : React-Native-Camera

on top of it follow the below steps: App Gradle:

dependencies {
    compile project(':react-native-camera')
    api project(':react-native-vector-icons')
    api project(':react-native-i18n')
    api fileTree(include: ['*.jar'], dir: 'libs')
    api 'com.android.support:appcompat-v7:26.0.1'
    api 'com.facebook.react:react-native:+'
    // From node_modules
}

Project Gradle below all projects:

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "26.1.0"
            }
        }
    }
}

Let me know if still facing issues with this plugin.

DILIP KOSURI
  • 455
  • 5
  • 10