Task :app:processDebugResources FAILED - REACT-NATIVE - ANDROID-STUDIO - react-native

im trying to run the app in my real device using android studio, eveything is ready and correct, but when i run react-native run-android it will first says connect to the server but then this error appears:
want to use the device as debugger

For running expo apps, you would normally do this using the command line.
Navigate to the root of your project, then (if you still have all the defaults set) you should be able to open a terminal in that directory and type npm run start. This will start the metro bundler and the other react native tools.
The first time doing this might take a while, but when it's done, you should see a QR code. Scan it with your device, you should be prompted to download the expo app and then your application will run on your phone. You only need to download the expo app once, and all the apps you develop using expo will run on it.
I'm not totally sure if this answers your question, but I hope this helped.
*note that this assumes that you have and use npm, the process is slightly different for yarn and other package managers. If npm run start doesn't work for you, make sure you have npm in the PATH variable, and check the package.json file. You should see an entry in scripts - "start": "expo start". You need to type npm run then whatever your key is for the script that has a value of "expo start"

Related

Metro bundler link 19000 shows json dump on react native expo instead of bundler web page with qr code

I usually run expo start or expo start -c and a browser will auto open at localhost:19000 with the metro bundler details that displays the qr code, connection: tunnel, lan, local, and of course the exp: address of the app.
Suddenly, when I run expo start, the browser no longer open. and when I navigate to localhost:19000, it shows a json dump:
{"name":"litplans","slug":"litplans","version":"1.0.0","orientation":"portrait","icon":"./assets/icon.png","userInterfaceStyle":"light","splash":{"image":"./assets/splash.png","resizeMode":"contain","backgroundColor":"#ffffff","imageUrl":"http://127.0.0.1:19000/assets/./assets/splash.png"},"updates":{"fallbackToCacheTimeout":0},"assetBundlePatterns":["**/*"],"ios":{"supportsTablet":true,"bundleIdentifier":"com.mallsecinc.litplans"},"android":{"adaptiveIcon":{"foregroundImage":"./assets/adaptive-icon.png","backgroundColor":"#FFFFFF","foregroundImageUrl":"http://127.0.0.1:19000/assets/./assets/adaptive-icon.png"}},"web":{"favicon":"./assets/favicon.png"},"_internal":{"isDebug":false,"projectRoot":"C:\\sites\\apps\\litplans","dynamicConfigPath":null,"staticConfigPath":"C:\\sites\\apps\\litplans\\app.json","packageJsonPath":"C:\\sites\\apps\\litplans\\package.json"},"sdkVersion":"45.0.0","platforms":["ios","android","web"],"developer":{"tool":"expo-cli","projectRoot":"C:\\sites\\apps\\litplans"},"packagerOpts":{"scheme":null,"hostType":"lan","lanType":"ip","devClient":false,"dev":true,"minify":false,"urlRandomness":"2x-kif","https":false},"mainModuleName":"node_modules\\expo\\AppEntry","__flipperHack":"React Native packager is running","debuggerHost":"127.0.0.1:19000","logUrl":"http://127.0.0.1:19000/logs","hostUri":"127.0.0.1:19000","bundleUrl":"http://127.0.0.1:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false","iconUrl":"http://127.0.0.1:19000/assets/./assets/icon.png"}
The only thing that I did different is uninstall and installing node.js.
To trouble shoot, I've done the following:
Try to run an exisitng expo project.
List item
start a brand new expo project.
remove node_modules and install again
remove expo module and install again
Metro Bundler UI is no longer available after expo-cli#6.0.0
https://blog.expo.dev/sunsetting-the-web-ui-for-expo-cli-ab12936d2206
For me using "start": "expo start" instead of "start": "expo start --dev-client" worked maybe if you share what your dependencies look like it would be helpful

I'm getting an Expo Devtools Error when I start Metro after updating Expo

I have just updated Expo to version 5.3.0, and now I am getting this error:
"Error loading DevTools, No scheme specified for development client"
The error appears on a black screen in the browser instead of the expected devtools. The same thing happens when I run either "yarn start" or "npm start".
I have tried reinstalling Expo again, and reinitiating my project again.
So what is the scheme? And how do I include it in my project?
I noticed that in the command line I was also getting this error: "Linking is disabled because the client scheme cannot be resolved". I did a search and found a solution on GitHub: https://github.com/expo/expo-cli/issues/4140.
Solution:
npx uri-scheme
And then
npx uri-scheme add project-name
Try running "expo start" instead.
yarn start or npm start maybe running expo start --dev-client
change it to expo start in
package.json

Expo Web starts Automatically

When I run the command "yarn start", the expo web starts automatically, and even if I open the expo client app on my iPhone the link on my app takes me to Safari and opens up a webpage. How can I open the app on expo CLI and not on my phone's browser (Safari)?
I have also tried the command "expo start --ios" and when I run it I get the error
"Simulator not installed. Please visit
https://developer.apple.com/xcode/download/ to download Xcode and the
iOS simulator. If you already have the latest version of Xcode
installed, you may have to run the command sudo xcode-select -s /Applications/Xcode.app".
I don't want to run the app on a simulator or phone's browser instead on my phone using expo client
I was dealing with this issue also hoping someone would find a solution. However, I have found the solution that worked for me at least. What I did is installed the react-native cli (reinstall if already installed) and then ran npm install in my project and it went back to normal and stopped going on my phones browser. Search documentation regarding this to install those things. I installed them in the order stated and it worked.
try update your expo-cli version and see if it helps. npm install -g expo-cli
Below is my situation,
By default Expo uses yarn. I installed any new dependencies using npm, then by default expo is built with web.
Solution:
use yarn always to install new dependencies or
use npm install once to install and now expo will build project with android or ios
On Linux try with sudo:
sudo npm install -g expo-cli
Then install packages and run:
yarn
Then run the following to clear cache and start expo:
expo start -c
This issue usually happens when you install a new npm package. You can either uninstall/reinstall the package or run the above three steps and solve your problem.

Getting error while creating a new Project

I'm new to reactnative. I have followed steps to install reactnative properly but, while creating a new project, I'm getting an error. I'm using Windows 7 64 bit with i3 processor.
c:\ReactNativeProjects>react-native init AwesomeProject
Command npm install --save --save-exact react-native failed.
My Folder contains only one file
Since you are starting to use React Native, consider using Expo, I've used it and it makes developing, debugging, testing and deploying to the apple store and google play easier.
According to the official docs:
Expo is the easiest way to start building a new React Native
application. It allows you to start a project without installing or
configuring any tools to build native code - no Xcode or Android
Studio installation required (see Caveats).
Assuming that you have Node installed, you can use npm to install the
Expo CLI command line utility:
npm install -g expo-cli
Then run the following commands to create a
new React Native project called "AwesomeProject":
expo init AwesomeProject
cd AwesomeProject
npm start
This will start a development server for
you.
I've answered a question in SO for the steps and what happens when you build your .apk and .ipa files using Expo, have a look at that as well.
These are my steps to get rid of this error:
Please upgrade your npm
npm install -g npm#latest
Run npm cache clean command in Command prompt ( With some element of doubt for cache presence)
3.Ran react-native init in command prompt as Administrator (on Windows OS), hoping works well with sudo react-native init on Mac OS
If still problem persist make sure that you have followed each and every step mentioned in Documentation i.e. installed JDK, PYTHON, NODE.
Refer to this link For windows

Why I am not able to run react-native application on my android device?

I am getting this error when I try to run react-native application on my device.
Steps I did:
react-native init SampleApp
cd SampleApp
react-native run-android
react-native start
PS: On first attempt I did successfully run react-native app. Now I am getting this error. I searched a lot but couldn't find solution yet.
Normally, running react-native run-android will open up another command prompt to start the React Packager.
If the packager is somehow not started properly, you can try the following steps:
Run react-native start first to start the packager server manually.
Run react-native run-android which it will detect the packager is running and proceed with deploying the application into the device/emulator.
First, you mus open the react-native local packet server:
react-native start or npm start.
If there is still a problem, may be:
The IP address might be wrong.
Phone cannot access the IP address
Shake your devices show Menu(or click your devices Menu), click the last item dev config setup your computer ip, like 192.168.*.*:8081
The reason is that another application takes port 8081, which is needed for running Metro Bundler. After doing some research, I found out someone does "react-native start" to start the bundler before running "react-native run-ios/android". Running "react-native run-ios" is successful when I previously started the Bundler. After running "react-native run-android", the app can be viewed. However, after could click R to reload the app, it shows 404.
Make sure your port 8081 is not taken by another app. If so, every time when we type "react-native run-ios/android", the Bundler can be automatically started.
When the app is loaded, the window of Bundler should have a progress bar showing the detail of loading the bundle file under ios/android.
BUNDLE [android, dev] ./index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (481/481), done.