Repository navigation
React native is not creating apk in emulator #25534
Copy link
Copy link
Closed
Labels
BugRan CommandsOne of our bots successfully processed a command.One of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
I have successfully build react-native app folder according to this http://facebook.github.io/react-native/docs/getting-started documentation
But, when I am running react-native run-android in cmd, it is showing me this -
info Starting JS server...
info Installing the app...
> Task :app:mergeDebugResources FAILED
9 actionable tasks: 8 executed, 1 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Specified AAPT2 executable does not exist: C:\Users\DE\.gradle\caches\transforms-2\files-2.1\e3571e1615ccf7c32524cbf1a8ed0eb8\aapt2-3.4.1-5326820-windows\aapt2.exe
* 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 55s
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
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Specified AAPT2 executable does not exist: C:\Users\DE\.gradle\caches\transforms-2\files-2.1\e3571e1615ccf7c32524cbf1a8ed0eb8\aapt2-3.4.1-5326820-windows\aapt2.exe
* 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 55s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\Users\DE\AwesomeApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:75:39)
at buildAndRun (C:\Users\DE\AwesomeApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:137:41)
at C:\Users\DE\AwesomeApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:103:12
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at async Command.handleAction (C:\Users\DE\AwesomeApp\node_modules\@react-native-community\cli\build\cliEntry.js:160:7)```
Update1 -
OS: Windows 10
CPU: (4) x64 Intel(R) Pentium(R) CPU G4560 @ 3.50GHz
Memory: 778.42 MB / 3.91 GB
Binaries:
Node: 12.6.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5522156
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugRan CommandsOne of our bots successfully processed a command.One of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Activity
react-native-bot commentedon Jul 7, 2019
Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?
👉 Click here if you want to take another look at the Bug Report issue template.
eriffat896 commentedon Jul 7, 2019
Sure, I have updated the problem
react-native-bot commentedon Jul 7, 2019
Can you run
react-native infoand edit your issue to include these results under the React Native version: section?Details
If you believe this information is irrelevant to the reported issue, you may write `[skip envinfo]` alongside an explanation in your Environment: section.eriffat896 commentedon Jul 7, 2019
please check the updated problem I have included the result of
react-native inforeact-native-bot commentedon Jul 20, 2019
I am closing this issue because it does not contain the necessary environment info, and there has been no followup in a while.
If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.
msf26 commentedon Dec 24, 2019
hello.i have a problem like this . please help me
PS F:\Learn\Full\React Native\project\SampleReactNativeProject2> react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 863 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
Could not unzip C:\Users\Mamal.gradle\wrapper\dists\gradle-5.5-all\byeise1led9a3w3p149d02kfj\gradle-5.5-all.zip to C:\U
sers\Mamal.gradle\wrapper\dists\gradle-5.5-all\byeise1led9a3w3p149d02kfj.
Reason: error in opening zip file
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at org.gradle.wrapper.Install.unzip(Install.java:219)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:75)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
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
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at org.gradle.wrapper.Install.unzip(Install.java:219)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:75)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
at checkExecSyncError (child_process.js:609:11)
at execFileSync (child_process.js:627:15)
at runOnAllDevices (F:\Learn\Full\React Native\project\SampleReactNativeProject2\node_modules@react-native-communit
y\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (F:\Learn\Full\React Native\project\SampleReactNativeProject2\node_modules@react-native-community\cl
i-platform-android\build\commands\runAndroid\index.js:158:41)
at F:\Learn\Full\React Native\project\SampleReactNativeProject2\node_modules@react-native-community\cli-platform-an
droid\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Command.handleAction (F:\Learn\Full\React Native\project\SampleReactNativeProject2\node_modules\react-nativ
e\node_modules@react-native-community\cli\build\index.js:164:9)
PS F:\Learn\Full\React Native\project\SampleReactNativeProject2>
martin-richter-uk commentedon Feb 20, 2020
Go to android/gradle/wrapper/gradle-wrapper.properties
Change the following line:
If still problems with path:
sdk.dir = /Users/USERNAME/Library/Android/sdk
Where USERNAME is your macOS username