react native Admob is not working android - react-native

Task :app:processDebugManifest FAILED
/Users/balwindersingh/Desktop/WEBSITETOON/InstagramUI/InstagramUI/android/app/src/debug/AndroidManifest.xml:22:18-91 Error:
Attribute application#appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:7:5-117 to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute application#appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:7:5-117 to override.
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 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

Related

How do i build react-native application

i just created a new react-native app using npx create-react-native-app myapp which was successfully created. but when i try to build it using gradlew assembleRelease, i get this error
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Failed to find Platform SDK with path: platforms;android-30
* 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.8/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 43s
it appears like teres a gradle problem. how do i fix it?

Can not Resolve React Native Camera MLKit Dependencies RN 0.62.0

React Native: 0.62.0
react-native-camera: git+https://git#github.com/react-native-community/react-native-camera.git
My app runs fine using react-native run-android but when I try to generate the .apk it fails with the following error
Error Message:
FAILURE: Build failed with an exception.native-camera:mlkitReleaseCompileClasspath > Resolve dependencies of :react-native-camera:mlkitReleaseRu
* What went wrong:
Could not determine the dependencies of task ':react-native-camera:compileMlkitReleaseJavaWithJavac'.
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
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.0.1/userguide/command_line_interface.html#sec:command_line_warnings

How to start project on react native

I installed everything on my computer and also set all environment variables of path and android_home but I still got these error please help me to solve my problem. My android studio is also running and the emulator is running too but I don't get what's the problem while running my react native app.
C:\Users\Pandat\Desktop\React\AwesomeProject>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
Task :app:processDebugManifest FAILED
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
10 actionable tasks: 2 executed, 8 up-to-date
C:\Users\Pandat\Desktop\React\AwesomeProject\android\app\src\debug\AndroidManifest.xml:7:7-38 Error:
Attribute application#name value=(com.example.app) from AndroidManifest.xml:7:7-38
is also present at AndroidManifest.xml:7:7-38 value=(com.awesomeproject.MainApplication).
Suggestion: add 'tools:replace="android:name"' to element at AndroidManifest.xml:8:5-14:43 to override.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute application#name value=(com.example.app) from AndroidManifest.xml:7:7-38
is also present at AndroidManifest.xml:7:7-38 value=(com.awesomeproject.MainApplication).
Suggestion: add 'tools:replace="android:name"' to element at AndroidManifest.xml:8:5-14:43 to override.
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 39s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Users\Pandat\Desktop\React\AwesomeProject\android\app\src\debug\AndroidManifest.xml:7:7-38 Error:
Attribute application#name value=(com.example.app) from AndroidManifest.xml:7:7-38
is also present at AndroidManifest.xml:7:7-38 value=(com.awesomeproject.MainApplication).
Suggestion: add 'tools:replace="android:name"' to element at AndroidManifest.xml:8:5-14:43 to override.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute application#name value=(com.example.app) from AndroidManifest.xml:7:7-38
is also present at AndroidManifest.xml:7:7-38 value=(com.awesomeproject.MainApplication).
Suggestion: add 'tools:replace="android:name"' to element at AndroidManifest.xml:8:5-14:43 to override.
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 39s
at checkExecSyncError (child_process.js:610:11)
at execFileSync (child_process.js:628:15)
at runOnAllDevices (C:\Users\Pandat\Desktop\React\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\Users\Pandat\Desktop\React\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\Pandat\Desktop\React\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Command.handleAction (C:\Users\Pandat\Desktop\React\AwesomeProject\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:164:9)
May be you should rename your react native app and the project package by using this library
https://www.npmjs.com/package/react-native-rename
npm install react-native-rename
react-native-rename "Travel App" -b com.junedomingo.travelapp
You named your react-native project new ... and this is not a valid name for java-package (cause it is a keyword)...
The very last line of the error message shows
at async Command.handleAction (C:\Users\Pandat\Desktop\React\new\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:164:9)
You cannot have a keyword in your path name for the project so names like
com.new.project
com.class.sample
etc are not allowed
change your name to something which is not reserved
like C:\Users\Pandat\Desktop\React\sample
use react-native run-android instead of npx react-native run-android it works for me . hope it too will work for you. Fell free to ask for Doubts.

sudo react-native run-android giving error

I have no idea what is the error when i want to run my react native app.
info Starting JS server...
info Installing the app...
> Task :app:processDebugManifest FAILED
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
10 actionable tasks: 3 executed, 7 up-to-date
/var/www/html/react/LotteryApp/android/app/src/debug/AndroidManifest.xml:22:18-91 Error:
Attribute application#appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-117 to override.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application#appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-117 to override.
* 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 5s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/var/www/html/react/LotteryApp/android/app/src/debug/AndroidManifest.xml:22:18-91 Error:
Attribute application#appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-117 to override.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application#appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-117 to override.
* 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 5s
at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (/var/www/html/react/LotteryApp/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:75:39)
at buildAndRun (/var/www/html/react/LotteryApp/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:137:41)
at then.result (/var/www/html/react/LotteryApp/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:103:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
It was working fine yesterday. I can't understand on the above code. What kind of error is this ? Please help on this. I tied to find on google. But cant find anything. Thanks in advance.
Did you build the app with Android studio once?
If not, build it first in Android Studio and install it through Android Studio.
To Build the app in android studio:
Open Android Studio.
Open react_native_project/android with Android Studio.
Wait for all it to build automatically, if some errors are present, try running Build > Clean Build.
Gradle should build successfully.
Then try:react-native run-android.
If it still does not work, stop the process and then run react-native start -- --reset-cache

Generate Apk gives erron in react-native

I try to generate an apk however it gives me an error on Command Prompt:
What went wrong: Execution failed for task ':app:signReleaseBundle'.
1 exception was raised by workers: java.lang.RuntimeException: java.lang.RuntimeException: jarsigner.exefailed with exit code 1 :
jarsigner: key associated with my-key-alias not a private key
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 6.0. Use '--warning-mode all' to show the
individual deprecation warnings. See
https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
Anyone can help me about this error ?
If you previously were building a bundle release with different keystore, please do clean before.
Launching ./gradlew clean shall help.