Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React native is not creating apk in emulator #25534

Closed
eriffat896 opened this issue Jul 7, 2019 · 7 comments
Closed

React native is not creating apk in emulator #25534

eriffat896 opened this issue Jul 7, 2019 · 7 comments
Labels
Bug Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@eriffat896
Copy link

eriffat896 commented Jul 7, 2019

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

@eriffat896 eriffat896 added the Bug label Jul 7, 2019
@react-native-bot
Copy link
Collaborator

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.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Jul 7, 2019
@eriffat896
Copy link
Author

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.

Sure, I have updated the problem

@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the React Native version: section?

If you believe this information is irrelevant to the reported issue, you may write `[skip envinfo]` alongside an explanation in your Environment: section.

@eriffat896
Copy link
Author

Can you run react-native info and edit your issue to include these results under the React Native version: section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] alongside an explanation in your Environment: section.

please check the updated problem I have included the result of react-native info

@react-native-bot
Copy link
Collaborator

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
Copy link

msf26 commented Dec 24, 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.

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
Copy link

Go to android/gradle/wrapper/gradle-wrapper.properties
Change the following line:

  • distributionUrl=https://services.gradle.org/distributions/gradle-5.5-all.zip
  • distributionUrl=https://services.gradle.org/distributions/gradle-6.0.1-all.zip

If still problems with path:

  • Go to the android/ directory of your react-native project
  • Create a file called local.properties with this line:
    sdk.dir = /Users/USERNAME/Library/Android/sdk
    Where USERNAME is your macOS username

@facebook facebook locked as resolved and limited conversation to collaborators Oct 11, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants