Cannot build RN App after integrating Sentry - android

OS:
MacOS
Platform:
Android
SDK:
#sentry/react-native (2.0.0)
react-native version: 0.61.4
Are you using Expo?
No
Are you using sentry.io or on-premise?
sentry.io (SaaS)
I have following issue:
When I try to to build the project by this command
npx react-native run-android
It fires this error
Task :sentry_react-native:compileDebugJavaWithJavac FAILED
570 actionable tasks: 3 executed, 567 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sentry_react-native:compileDebugJavaWithJavac'.
> java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0
Expected result:
The project should be built without issue

Have you tried first doing
yarn add jetifier and then npx jetify
Then building your app.
Try this and do let me know in case of any concerns.

It worked when I switched
#sentry/react-native to version "^1.3.8"
looks it was a conflict with Gradle version

Related

Error And Failed When Try To Use expo run:android React Native Expo

Could anyone figure out why when I build using expo run:android I got failed ?
This the detail error :
> Configure project :expo-file-system
WARNING: Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
> Configure project :expo-structured-headers
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
> Configure project :expo
Using expo modules
- expo-application (4.0.2)
- expo-constants (13.0.2)
- expo-crypto (10.1.2)
- expo-error-recovery (3.0.5)
- expo-file-system (13.1.4)
- expo-font (10.0.5)
- expo-json-utils (0.2.1)
- expo-keep-awake (10.0.2)
- expo-manifests (0.2.4)
- expo-modules-core (0.6.5)
- expo-screen-orientation (4.1.2)
- expo-sharing (10.1.1)
- expo-splash-screen (0.14.2)
- expo-sqlite (10.1.1)
- expo-structured-headers (2.1.1)
- expo-updates (0.11.6)
- expo-web-browser (10.1.1)
> Configure project :react-native-reanimated
AAR for react-native-reanimated has been found
E:\Application\daastradingapp\node_modules\react-native-reanimated\android\react-native-reanimated-64-jsc.aar
> Task :react-native-reanimated:replaceSoTaskDebug FAILED
FAILURE: Build failed with an exception.
* Where:
Build file 'E:\Application\daastradingapp\node_modules\react-native-reanimated\android\build.gradle' line: 122
* What went wrong:
Execution failed for task ':react-native-reanimated:replaceSoTaskDebug'.
> Warning: Could not find file E:\Application\daastradingapp\android\app\build\tmp\libSo\jni\x86\libfbjni.so to copy.
* 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
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.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 51s
569 actionable tasks: 6 executed, 563 up-to-date
E:\Application\daastradingapp\android\gradlew.bat exited with non-zero code: 1
Error: E:\Application\daastradingapp\android\gradlew.bat exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\Dennis_Liu\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\spawn-async\src\spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:520:26)
at ChildProcess.emit (events.js:400:28)
at ChildProcess.cp.emit (C:\Users\Dennis_Liu\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1055:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
...
at spawnAsync (C:\Users\Dennis_Liu\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\spawn-async\src\spawnAsync.ts:26:19)
at spawnGradleAsync (C:\Users\Dennis_Liu\AppData\Roaming\npm\node_modules\expo-cli\src\commands\run\android\spawnGradleAsync.ts:83:18)
at assembleAsync (C:\Users\Dennis_Liu\AppData\Roaming\npm\node_modules\expo-cli\src\commands\run\android\spawnGradleAsync.ts:57:16)
at actionAsync (C:\Users\Dennis_Liu\AppData\Roaming\npm\node_modules\expo-cli\src\commands\run\android\runAndroid.ts:143:9)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
Note:
I use expo bare worfklow
Finally solved the problem.
In Expo if with use a Native Module we cannot run in Expo Go.
If we want to publish to Expo Dashboard with Native Module
Use EAS Build.
Example :
Run eas build --platform android to build for Android.
Run eas build --platform ios to build for iOS.
Alternatively, you can run eas build --platform all to build for Android and iOS at the same time.
The complete documentation can be found in here :
EAS Documentation Expo

Cannot run android in react native due to "Could not find com.mg.RxCustomizedImagePicker:fileprovider:1.0.0"

This is my first time running react native Andriod code, IOS code runs fine, but when I try to run android code, I got this error, what do you suggest I should do?
$ react-native run-android
yarn run v1.22.4
$ react-native run-android
warn The following packages use deprecated "rnpm" config that will stop working from next release:
- native-base: https://github.com/GeekyAnts/NativeBase#readme
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1113 file(s) to forward-jetify. Using 12 workers...
info JS server already running.
info Installing the app...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not find com.mg.RxCustomizedImagePicker:fileprovider:1.0.0.
Searched in the following locations:
- file:/Users/XXXlaptop/.m2/repository/com/mg/RxCustomizedImagePicker/fileprovider/1.0.0/fileprovider-1.0.0.pom
- file:/Users/XXXlaptop/.m2/repository/com/mg/RxCustomizedImagePicker/fileprovider/1.0.0/fileprovider-1.0.0.jar
- file:/Users/XXXlaptop/Documents/Code/uf-mobile/node_modules/react-native/android/com/mg/RxCustomizedImagePicker/fileprovider/1.0.0/fileprovider-1.0.0.pom
- file:/Users/XXXlaptop/Documents/Code/uf-mobile/node_modules/react-native/android/com/mg/RxCustomizedImagePicker/fileprovider/1.0.0/fileprovider-1.0.0.jar
- file:/Users/XXXlaptop/Documents/Code/uf-mobile/node_modules/jsc-android/dist/com/mg/RxCustomizedImagePicker/fileprovider/1.0.0/fileprovider-1.0.0.pom
- file:/Users/XXXlaptop/Documents/Code/uf-mobile/node_modules/jsc-android/dist/com/mg/RxCustomizedImagePicker/fileprovider/1.0.0/fileprovider-1.0.0.jar
In root of your project first run :
cd android
then run :
gradlew clean
after that , when gradle cleaned project run :
cd ..
finally run :
npx react-native run-android

React Native Failed to build after Installing react-navigation and react-native-gesture-handler

I did the following
react-native init project-name
yarn add react-navigation react-native-gesture-handler and
react-native run-android
The dependencies installed successfully but the app failed to build with the following errors
> Task :react-native-gesture-handler:packageDebugResources FAILED
17 actionable tasks: 8 executed, 9 up-to-date
> FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-gesture-handler:packageDebugResources'.
> Could not resolve all files for configuration ':react-native-gesture-handler:_
internal_aapt2_binary'.
> Failed to transform artifact 'aapt2-windows.jar (com.android.tools.build:aa
pt2:3.4.1-5326820)' to match attributes {artifactType=_internal-android-aapt2-bi
nary, org.gradle.usage=java-runtime-jars}.
> org.gradle.api.GradleException: Could not read path 'C:\Users\DevLewa\.g
radle\caches\transforms-2\files-2.1\3d408b3640f7dfba25695085d22596b0\aapt2-3.4.1
-5326820-windows'.
I have searched all through github issues but found no helping information, how do I resolve this, I have being on it since morning today.
Thanks
I had the same problem with some of my initialized projects using reac-native cli. it would be solved by running: react-native link in your project directory. I hope it would work for you as me.
If it was helpful please vote me up:)

Ionic 4 Build Issue when add cordova-firebase plugin

When I create basic IONIC 4 application and run > ionic cordova build android
it works fine and apk generated.
When I add plugin firebase > ionic cordova plugin add cordova-plugin-firebase
It failed to build application.
ERROR:
\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Android Build failed after adding Crosswalk to Ionic

Got excited about Ionic adding Crosswalk and now my project won't build. The project was compiling and working before updating and adding Crosswalk. Anyone have any suggestions on how I can correct the error below? I prefer not to rollback. Thank goodness for version control :)
System information:
OS: Windows 8
Node Version: v0.10.32
Cordova CLI: 4.2.0
Ionic Version: 1.0.0-beta.14
Ionic CLI Version: 1.3.1
AngularJS v1.3.8
WARNING [Project: :org.apache.cordova.engine.crosswalk:382300-xwalk_core_library] Current NDK support is deprecated. Alternative will be provided in the future.
:mergeDebugResourcesC:\Users\platforms\android\build\intermediates\exploded-aar\android.org.apache.cordova.engine
.crosswalk\rsgapp382300-xwalk_core_library\unspecified\debug\res\drawable-hdpi-v4\color_picker_advanced_select_handle.png
ERROR: Unable to open PNG file
Error: Failed to run command:
C:\Users\AppData\Local\Android\sdk\build-tools\21.0.2\aapt.exe s-i C:\Users\platforms\android\build\intermediates\exploded-aar\android.org.apache.cordova.engine.crosswalk 382300-xwalk_core_library\unspecified\debug\res\drawable-hdpi-v4\color_picker_advanced_select_handle.png -o C:\Users\platforms\android\build\intermediates\res\debug\drawable-hdpi-v4\color_picker_advanced_select_handle.png
Error Code: 42
Output: C:\Users\platforms\android\build\intermediates\exploded-aar\android.org.apache.cordova.engine.crosswalk382300-xwalk_core_library\unspecified\debug\res\drawable-hdpi-v4\color_pick
er_advanced_select_handle.png
ERROR: Unable to open PNG file
:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':mergeDebugResources'.
Error: Failed to run command: C:\Users\AppData\Local\Android\sdk\build-tools\21.0.2\aapt.exe s -i C:\Users\platforms\android\build\intermediates\exploded-aar\android.org.apache.cordova.engine.crosswalk 382300-xwalk_core_library\unspecified\debug\res\drawable-hdpi-v4\color_picker_advanced_select_handle.png -o C:\Users\platforms\android\build\intermediates\res\debug\drawable-hdpi-v4\color_picker_advanced_select_handle.png
Error Code: 42
Output: C:\Users\platforms\android\build\intermediates\exploded-aar\android.org.apache.cordova.engine.crosswalk382300-xwalk_core_library\unspecified\debug\res\drawable-hdpi-v4\color_picker_advanced_select_handle.png
ERROR: Unable to open PNG file
Looks like you were getting similar errors to this question, which was that on Windows, path names are restricted to 260 characters, so moving to a directory with a shorter path name should fix your issues.

Categories

Resources