Skip to content

Instantly share code, notes, and snippets.

@maiquealmeida
Created May 2, 2019 19:44
Show Gist options
  • Save maiquealmeida/49945af313ae01279f85d1716d4ed76c to your computer and use it in GitHub Desktop.
Save maiquealmeida/49945af313ae01279f85d1716d4ed76c to your computer and use it in GitHub Desktop.
Após instalar o react-native-camera, ao compilar o projeto uma mensagem de erro passa ser exibida> Task :app:transformResourcesWithMergeJavaResForDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > More than one file was found with OS independent …
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.fardos"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
+ missingDimensionStrategy 'react-native-camera', 'mlkit'
// multiDexEnabled true // nao eh necessário
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
+ packagingOptions {
+ exclude 'META-INF/androidx.exifinterface_exifinterface.version'
+ }
}
dependencies {
implementation project(':react-native-camera')
implementation project(':react-native-vector-icons')
implementation project(':react-native-gesture-handler')
implementation project(':@react-native-community_async-storage')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
@meruem44
Copy link

meruem44 commented Mar 9, 2020

Tenta linkar manualmente, sempre acontece esse erro quando instalo o RN-camera.
https://react-native-community.github.io/react-native-camera/docs/installation segue esse passo a passo.

@maiquealmeida
Copy link
Author

Tenta linkar manualmente, sempre acontece esse erro quando instalo o RN-camera.
https://react-native-community.github.io/react-native-camera/docs/installation segue esse passo a passo.

Obrigado pelo conselho!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment