react-native-maps: React-native build error: Execution failed for task ':react-native-maps:prepareComAndroidSupportAppcompatV72301Library'. > Could not expand ZIP

I created a new react-native project on a Windows 10 system, installed the react-native-maps package and rnpm link, but when starting the project I get a Build failed error.

What is causing this problem?

react-native init myapp
npm install react-native-maps --save
rnpm link
react-native run-android

Versions

react-native-cli: 1.3.0
react-native: 0.39.1
node: v7.2.1
npm: 3.10.10

enter image description here

Error

JS server already running.
Running C:\Users\y\AppData\Local\Android\Sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:react-native-maps:compileLint
:react-native-maps:copyReleaseLint UP-TO-DATE
:react-native-maps:preBuild UP-TO-DATE
:react-native-maps:preReleaseBuild UP-TO-DATE
:react-native-maps:checkReleaseManifest
:react-native-maps:preDebugAndroidTestBuild UP-TO-DATE
:react-native-maps:preDebugBuild UP-TO-DATE
:react-native-maps:preDebugUnitTestBuild UP-TO-DATE
:react-native-maps:preReleaseUnitTestBuild UP-TO-DATE
:react-native-maps:prepareComAndroidSupportAppcompatV72301Library FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-maps:prepareComAndroidSupportAppcompatV72301Library'.
> Could not expand ZIP 'C:\Users\y\AppData\Local\Android\sdk\extras\android\m2repository\com\android\support\appcompat-v
7\23.0.1\appcompat-v7-23.0.1.aar'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7.247 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

(node:8824) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read prop
erty 'message' of undefined
(node:8824) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are
not handled will terminate the Node.js process with a non-zero exit code.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 19
  • Comments: 30 (1 by maintainers)

Most upvoted comments

Helped with

Execution failed for task ‘:app:prepareSrolkReactNativeFilePickerUnspecifiedLibrary’. Could not expand ZIP …node_modules\react-native-file-picker\android\build\outputs\aar\react-native-file-picker-release.aar

(on windows):

cd android 
gradlew clean 
cd ..
react-native run-android

or

cd android && gradlew clean && cd .. && react-native run-android

Try running react-native run-android 5-6 times consecutively. Each time it got further and further, until it finally got past all the tasks that relate to react-native-maps. Kinda annoying to have to do this as a workaround…

@alexicum instructions work although i got gradlew command doesn’t exist should add ./ infront of gradlew

cd android && ./gradlew clean && cd … && react-native run-android

As suggested by @arthur-tse7 after running react-native run-android multiple times, I am able to run the app successfully.

To clearify, my situation has nothing to do with this project.

So I’ve been stuck on my project not running for awhile. Getting a bunch of errors relating to my packages such as:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:preparePocketConnectReactNativeOnesignalUnspecifiedLibrary'.
> Could not expand ZIP 'C:\Users\np\Documents\projects\Pockett\node_modules\react-native-onesignal\android\build\outputs\aar\react-native-onesignal-release.aar'.

What was the solution to get it working?? @arthur-tse7 run react-native run-android literally 14 times…

i just did npm update the react-native link and it worked for me

@alexicum for windows

gradlew clean

replace it with

./gradlew clean

your solution worked for me ❤️

CD android gradlew clean

This is the key. I am not able to know the exact details but it works.

make sure you are connected to internet

Thanks guys!!! the “gradlew clean” solved another problem I was having. You guys are the best.

I have the same problem. Waiting for a solution …