React native in android studio Task wrapper not found in project app - react-native

I have set JAVA_HOME environment variables. I have created a react native project using npx react-native init projName, and opened it in AndroidStudio. Unable to build this project. In Android studio it gives error Task 'wrapper' not found in project 'app'.
Also jdk used is the jdk from android-studio.

Try File->New->Import Project, it will do the magic.

Related

Not able to create React native app using React native version 0.69.0

I have tried to install app using
npx react-native init ProjectName
But it has just created package and node module files and not created Platform-specific folders like android and ios.
Try rerunning this command in another folder.
Check if there any errors in terminal where you ran that command

A problem occurred configuring project ':#sentry_react-native' SDK location not found

I'm on MacOS trying to run a react native (0.59.9) app on Android emulator. I've integrated Sentry using the wizard. Works fine on iPhone. On Android, this happens:
I try to run the app w/ react-native run-android
Build fails.
A problem occurred configuring project ':#sentry_react-native'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
I go into the android folder and create a local.properties file and paste this in:
sdk.dir=C:/Users/my_name/Library/Android/sdk
I try again to run the app w/ react-native run-android
Build fails.
A problem occurred configuring project ':#sentry_react-native'.
The SDK directory '/Users/my_name/project_path/android/C:/Users/my_name/Library/Android/sdk' does not exist.
Why is it concatenating the SDK dir w/ my project path? That doesn't make sense to me. How do I fix this?
this isn't a Sentry issue, but an Android environment issue, please look at https://reactnative.dev/docs/getting-started.html and set your Android env. properly.
Look for "Android development environment", good luck :)

React Native missing script Android

I added a vector icon package in my React Native app. But After adding vector icon library I am trying to rebuild project using
**npm run android
react-native link**
But it's giving me an error
npm err missing script android react native
I have tried many solutions of updating package.json file from Github and I have tried to change the path of the environment but still same
I think you are using the wrong command to make debug build.
Following these steps:
install vector icon
link it from your project root directory using the command react-native link your_package_name
Use this command from your project root directory to make build react-native run-android

react native gradlew assembleRelease failed to execute appt

First stacktrace:
I am trying to produce an apk to my project but it always fail and produce the errors in the pictures
Please Help
Second stacktrace:
I think you can try by use Android Studio open android project inside react native and clean so build by Android Studio. This way work for me. I just can use gradle build command after update/reinstall Android Studio

Can run code with react native and expo, but cannot build apk with gradle assembleRelease

error : cannot determine java version 10.0.2
using latest android studio 3.1.3 and react native 0.56
Ive already built the key and copy the key to android/app folder as described.
when tried to run gradleW assembleReleased command, it has following error :
"cannot determine java version 10.0.2"