In my React Native app everything was working fine up until I decided to implement react-native-azurenotificationhub to connect my app to Azure Notifications Hub.
My app uses Auth0 for user authentication and up until now, I didn’t have any issues with it.
I’m on the latest version of all the packages, including React Native 0.63.1
I followed the instructions here to install the Azure Notifications Hub package and that’s when all the problems started https://github.com/CatalystCode/react-native-azurenotificationhub/blob/master/docs/android-installation.md
Now, I'm getting the following error:
> Configure project :app
WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
> Task :react-native-auth0:compileDebugJavaWithJavac 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.2/userguide/command_line_interface.html#sec:command_line_warnings
42 actionable tasks: 2 executed, 40 up-to-date
C:\Users\sam\source\repos\iQuest\Ingrid Mobile\Time\ingridtime\node_modules\react-native-auth0\android\src\main\java\com\auth0\react\A0Auth0Package.java:13: error: A0Auth0Package is not abstract and does not override abstract method createJSModules() in ReactPackage
public class A0Auth0Package implements ReactPackage {
^
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-auth0:compileDebugJavaWithJavac'.
> 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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Users\sam\source\repos\iQuest\Ingrid Mobile\Time\ingridtime\node_modules\react-native-auth0\android\src\main\java\com\auth0\react\A0Auth0Package.java:13: error: A0Auth0Package is not abstract and does not override abstract method createJSModules() in ReactPackage
I've been researching this for the last two days and answers are all over the place and I practically tried all of them to no avail. Any idea what's going on here?
Related
I am beginner in react-native. While building my app for android, I am getting this error
Task :react-native-community_toolbar-android:compileDebugJavaWithJavac 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.2/userguide/command_line_interface.html#sec:command_line_warnings
39 actionable tasks: 39 executed
Note: /home/kanhaiya/testapp/node_modules/#react-native-community/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/home/kanhaiya/testapp/node_modules/#react-native-community/toolbar-android/android/src/main/java/com/reactnativecommunity/toolbarandroid/ReactToolbar.java:107: error: IconImageInfo is not abstract and does not override abstract method getExtras() in HasImageMetadata
private static class IconImageInfo implements ImageInfo {
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-community_toolbar-android:compileDebugJavaWithJavac'.
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. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 25s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: /home/kanhaiya/testapp/node_modules/#react-native-community/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/home/kanhaiya/testapp/node_modules/#react-native-community/toolbar-android/android/src/main/java/com/reactnativecommunity/toolbarandroid/ReactToolbar.java:107: error: IconImageInfo is not abstract and does not override abstract method getExtras() in HasImageMetadata
private static class IconImageInfo implements ImageInfo {
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-community_toolbar-android:compileDebugJavaWithJavac'.
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. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 25s
at makeError (/home/kanhaiya/testapp/node_modules/execa/index.js:174:9)
at /home/kanhaiya/testapp/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (/home/kanhaiya/testapp/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/home/kanhaiya/testapp/node_modules/react-native/node_modules/#react-native-community/cli/build/index.js:192:9)
I have already linked react-native-community/toolbar-android in my project using react-native link #react-native-community/toolbar-android. Still it is giving error.
There are few steps, you can follow up, and see if things are working.
FIRST WAY:
cd Android && cd ./gradlew clean
Please note: ./gradlew <follow_by_script_command> for MacOS. For Windows, just do gradlew <follow_by_script_command>.
If you want to generate a bundle, then do this after the above commands:
./gradlew :app:bundleRelease
SECOND WAY:
Possible reason of this error is your RN version might be different from Android's build.gradle version which android/app/build.gradle. When you create a react-native app probably it create android app like:
implementation "com.facebook.react:react-native:+"
Try inspecting your node_modules folder, look for react-native folder and look for a folder with a number, that numbers are react-native version. For me it's 0.66.4 then update android/app/build.gradle:
implementation "com.facebook.react:react-native:0.66.4"
after running yarn upgrade #react-native-community/toolbar-android#^0.2.1, the problem is gone.If you are using npm then update the package to the latest.Happy Coding :)
Helo everyone, i'm new at react native and react. I'm trying to run a project from github, I keep getting this error. I tried many solutions but still getting it.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-push-notification:compileDebugJavaWithJavac'.
> 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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 11s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: Some input files use or override a deprecated API.
error Command failed with exit code 1.
Taking in consediration that when I start a new project, I can run it without any problem.
Thank you
I am trying to use React Native Keychain in my app.
I just install it yarn add react-native-keychain and then run yarn run android and get this error:
> Task :react-native-keychain:compileDebugJavaWithJavac 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
83 actionable tasks: 80 executed, 3 up-to-date
Note: /home/david/Desktop/Encarti/encarti-mobile-app-worker/node_modules/#react-native-community/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/david/Desktop/Encarti/encarti-mobile-app-worker/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
/home/david/Desktop/Encarti/encarti-mobile-app-worker/node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/DeviceAvailability.java:30: error: cannot find symbol
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE);
^
symbol: variable FEATURE_FACE
location: class PackageManager
/home/david/Desktop/Encarti/encarti-mobile-app-worker/node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/DeviceAvailability.java:34: error: cannot find symbol
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_IRIS);
^
symbol: variable FEATURE_IRIS
location: class PackageManager
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-keychain:compileDebugJavaWithJavac'.
> 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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
I saw this post: Compilation failed (android) after installation of react-native-keychain and tried the solution there but it still fails. How can I fix this problem?
share your code is more efficient :)
https://github.com/oblador/react-native-keychain/issues/351#issuecomment-640788608
Try this :
compileSdkVersion = 29
when you try to run the command:
react-native run-android
the following error occurs:
> Task :react-native-gesture-handler:compileDebugJavaWithJavac
Note: C:\Users\jefer\Desktop\react\new\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Package 'com.new' from AndroidManifest.xml is not a valid Java package name as 'new' is a Java keyword.
* 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 23s
23 actionable tasks: 21 executed, 2 up-to-date
error 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/getting-started.html
error Command failed: gradlew.bat app:installDebug
I've tried using:
cd android && gradlew clean
but it did not solve the problem ... I also deleted the android and iOS folders and used the commands:
react-native eject
react-native link
but it did not work.
Problem with your application package name
You set app package name is com.new in AndroifManifest.xml is not a valid package name. Change application package name because new is reserved keyword in java
I'm trying to build a react-native project cloned from github. Here is the github project.
After npm install. I tried the react-native run-android and I got this:
/var/www/html/test/sipsip/react-native-pjsip-app/node_modules/react-native-pjsip/android/src/main/java/com/carusto/ReactNativePjSip/PjSipModulePackage.java:12: error: PjSipModulePackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class PjSipModulePackage implements ReactPackage {
^
/var/www/html/test/sipsip/react-native-pjsip-app/node_modules/react-native-pjsip/android/src/main/java/com/carusto/ReactNativePjSip/PjActions.java:307: error: cannot find symbol
value.put(mapKey, map.getArray(mapKey).toArrayList());
^
symbol: method toArrayList()
location: interface ReadableArray
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
:react-native-pjsip:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-pjsip: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.
BUILD FAILED
Total time: 24.355 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've tried many solutions but none of them solved my issue. Do you have any idea how to fix this?
Additional info:
react-native version:
react-native-cli: 2.0.1
react-native: 0.41.2
I was facing the same problem today, and was solved just updating my react-native in the project using
react-native-git-upgrade
If you don't have it installed yet (the upgrader), you can call
npm install -g react-native-git-upgrade
Of course, there were some thousands of graddles to update, and .js files failing (Still working on it), but at least, I've passed the failure you described.
Delete /ios and /android folders
Then run react-native eject