Could not resolve all files for configuration ':package-remaster:debugCompileClasspath' - react-native

Im building a npm package for react-native, im using a .aar as dependecy, when rebuild the project in android studio no error, problem is when i install it in my react native project and build the apk with eas, im getting the error:
* What went wrong:1140[stderr] Execution failed for task ':package-remaster:generateDebugRFile'.1141[stderr]
> Could not resolve all files for configuration ':package-remaster:debugCompileClasspath'.1142[stderr]
> Failed to transform sdk.aar to match attributes {artifactType=android-symbol-with-package-name}.1143[stderr] > Execution failed for JetifyTransform: /home/expo/workingdir/build/node_modules/package-remaster/libs/sdk.aar.1144[stderr]
> Transform's input file does not exist: /home/expo/workingdir/build/node_modules/package-remaster/libs/sdk.aar. (See https://issuetracker.google.com/issues/158753935)
adding that im using expo with expo prebuild
added this in dependency:
dependencies {
implementation "com.facebook.react:react-native:+"
compileOnly files('../libs/sdk.aar')
}

Related

React-native-camera error when compiling android, react-native 0.60.5

Upgrade from react-native 0.59.8 to 0.60.5
Set missingDimensionStrategy 'react-native-camera', 'general'
Debug works fine, but
when compiling the release get the error:
Could not determine the dependencies of task ':react-native-camera:compileMlkitReleaseAidl'.
> Could not resolve all task dependencies for configuration ':react-native-camera:mlkitReleaseCompileClasspath'.
> Could not find com.google.firebase:firebase-ml-vision:12.0.1.
Required by:
project :react-native-camera
> Could not find com.google.firebase:firebase-ml-vision-face-model:12.0.1.
Required by:
project :react-native-camera

Project with path '../node_modules/react-native-code-push/android' could not be found in project ':app'

After updating react-native version 0.60.3 to 0.60.4, I am not able to build apk every time run the "react-native run-android" command an error message appears
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Front_End\android\app\build.gradle' line: 161
* What went wrong:
A problem occurred evaluating project ':app'.
> Project with path '../node_modules/react-native-code-push/android'
could not be found in project ':app'.
I have checked inside node_modules this module is present.

install react-native-video cant link

I install react-native-video by yarn,
when I install success,I use command 'react-native link',but failed,
so I link the files manually:
reference https://www.npmjs.com/package/react-native-video android part;
when it done,I use command 'react-native run-android',show this info:
* What went wrong:
A problem occurred configuring project ':react-native-video'.
Java 8 language support, as requested by 'android.enableD8.desugaring= true' i
n your gradle.properties file, is not supported when 'android.useDexArchive= fal
se'.
...
Command failed: gradlew.bat installDebug
can somebody help me to find out the problem?thank you so much
by the way,my react-native version is '0.58.6'.

Android build fails after flavor is added

I have a react native application ready for the release, after following the android documentation and have added flavors to the product
flavorDimensions "version"
productFlavors {
free {
dimension "version"
applicationId 'com.my-app.free'
}
}
The command react-native run-android fails the gradle build with the following error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-appboy-sdk:transformClassesWithDexForDebugAndroidTest'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
Considerations
If I comment the flavor in the gradle file the command runs without any problem.
Even with this error, I can assemble the apk without any errors using the command ./gradlew assembleRelease.
I can run the app using the android studio run configuration without any errors, this seems to be related to adding flavors and running with the react-native command
Please add below code in your android/build.gradle file, hope it will help you:
android {
dexOptions {
preDexLibraries = false
}
}
Also try below command if above not working:
react-native run-android --variant=developmentDebug

React Native - react-native-camera error building on Android

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?
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.