I recently started learning React-Native and was trying to run a project on Android emulator.However, this was succeeded at the first attempt, but now It doesn't, throwing the following error.
Execution failed for task ':app:installDebug'.
java.io.IOException: Cannot run program "C:\\Users\\Pavindu\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe": CreateProcess error=740, The requested operation requires elevation
Since this is a well known error message,I could find lot of answers regarding this error.The following were the actions I took according to those answers.But none of those helped me.
cmd /c react-native run-android
node_modules
and npm install
It is a great favor done,if anyone can help me in this case.Thanks in advance.
After struggling a lot, here is what I did to overcome the problem.
/Sdk
folder and pasted it in a different location while keeping the old SDK folder there. platform-tools
folder in copied SDK folder platform-tools
from android site and added it to new SDK folder. ANDROID_HOME
(I use windows) and android/build.properties
file in my react-native project.
sdk.dir="C:\\\\path\\\\to\\\\new\\\\sdk"
When I run react-native run-android
after these steps,all started working fine.
Note: I know that this seems hacky, but as a help for someone, I decided to write this .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.