react native react-native-mauron85-background-geolocation:processReleaseResources FAILED - react-native

Everything was working fine then suddenly I'm getting following error
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex
:react-native-mauron85-background-geolocation:processReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-mauron85-background-geolocation:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 23.413 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

I managed to fix this by changing one line in node_modules/react-native-mauron85-background-geolocation/android/lib/build.gradle
from
compile 'com.android.support:support-v4:+'
to
compile 'com.android.support:support-v4:23.+'

Related

error to assembleRelease my react native app after change windows

Task :app:checkReleaseAarMetadata FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:checkReleaseAarMetadata'.
Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
Failed to transform appcompat-1.2.0.aar (androidx.appcompat:appcompat:1.2.0) to match attributes {artifactType=android-aar-metadata, org.gradle.status=release}.
> Could not find appcompat-1.2.0.aar (androidx.appcompat:appcompat:1.2.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.2.0/appcompat-1.2.0.aar

Why when I want to run an Android yarn error like this?

Why when I want to run an Android yarn error like this?
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :app:processDebugResources FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
10 actionable tasks: 2 executed, 8 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource m
ipmap/ic_launcher (aka com.konspirasisnack:mipmap/ic_launcher) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource s
tring/app_name (aka com.konspirasisnack:string/app_name) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource m
ipmap/ic_launcher_round (aka com.konspirasisnack:mipmap/ic_launcher_round) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource s
tyle/AppTheme (aka com.konspirasisnack:style/AppTheme) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:13:7-23:18: AAPT: error: resource
string/app_name (aka com.konspirasisnack:string/app_name) not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. R
un with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 35s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnat
ive.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
react native versi 0.62.2
distributionUrl=https://services.gradle.org/distributions/gradle-6.0.1-all.zip
os windows 10
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
ANDROID_HOME = C:\Users\user\AppData\Local\Android\Sdk
JAVA_HOME = C:\Program Files\Java\jdk

Error: The resource `Path-to-project-root-directory\index.ts` was not found

I am working on a react-native project and wanted to generate the signed apk for deployment on Play store. I am following the
official documentation for this:
https://facebook.github.io/react-native/docs/signed-apk-android
Building unsigned apk, works just fine.
But for signed apk, after generating "my-upload-key.keystore" and placing it in /android/app directory (inlcluding other settings as guided in docs.), whenever I run command
"gradlew bundleRelease", it gives the following error:
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
error The resource Path-to-project-root-directory\index.ts was not found.. Run CLI with --verbose flag for more details.
Task :app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
Process 'command 'cmd'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1m 39s
4 actionable tasks: 1 executed, 3 up-to-date

Execution failed for task ':react-native-multi-image-selector:compileReleaseJavaWithJavac' in react native

I am just install react-native-multi-image-selector
and execute the link command ,
after am trying to build assembleDebug app
It shows an error
\node_modules\react-native-multi-image-selector\android\src\main\java\me\nereo\multi_image_selector\MultiImagePackage.java:17: error: method does not override or implement a method from a supertype
#Override
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
:react-native-multi-image-selector:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-multi-image-selector:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I don't know hoe to overcome this, am very new to react-native,
How can I solve this?

react native apk build fail when using react-native-razorpay

I'm trying to build an signed apk for my react-native code. I've used react-native-razorpay library for payment integration purpose.
On running cd android && ./gradlew assembleRelease in my project root directory I got stuck on following error.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-razorpay:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 22s
102 actionable tasks: 2 executed, 100 up-to-date
While running ./gradlew assembleRelease --info i get following in the last few lines-
....
....
Successfully started process 'command '/Users/clove/Library/Android/sdk/build-tools/27.0.3/aapt''
/Users/clove/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/37abea56216e7a3ad9a6c076b6dd1a92/res/values-v24/values-v24.xml:3:5-157: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
/Users/clove/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/37abea56216e7a3ad9a6c076b6dd1a92/res/values-v24/values-v24.xml:4:5-135: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
/Users/clove/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/37abea56216e7a3ad9a6c076b6dd1a92/res/values-v26/values-v26.xml:13:5-16:13: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
> Task :react-native-razorpay:verifyReleaseResources FAILED
Putting task artifact state for task ':react-native-razorpay:verifyReleaseResources' into context took 0.0 secs.
Up-to-date check for task ':react-native-razorpay:verifyReleaseResources' took 0.0 secs. It is not up-to-date because:
Task has failed previously.
All input files are considered out-of-date for incremental task ':react-native-razorpay:verifyReleaseResources'.
Unable do incremental execution: full task run
QueuedCruncher is using /Users/clove/Library/Android/sdk/build-tools/27.0.3/aapt
Shutdown finished in 0ms
:react-native-razorpay:verifyReleaseResources (Thread[Daemon worker Thread 18,5,main]) completed. Took 0.402 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-razorpay:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 16s
102 actionable tasks: 9 executed, 93 up-to-date
Found a solution. Turned out that the problem was due to configuration mismatch. the gradle version I was using was above 3, which requires the android sdk version 25 or above. Whereas react-native-razorpay was shipped with sdk version 23. So I changed those settings in node_modules and the build completed successfully.