"Android: Could not find ... appcompat-v7 - how to update preinstalled packages"

If you'd get an error in your Android build like: "Could not find com.android.support:appcompat-v7:24.2.0." or: "You have not accepted the license agreements of the following SDK components" Read this!


You can find an up to date version of this issue and fix
on our DevCenter

If you'd get an error in your Android build like:

Could not find com.android.support:appcompat-v7:24.2.0.

or:

You have not accepted the license agreements of the following SDK components:

it means that your Android build requires an Android package which is either not (yet) preinstalled (you can see which packages are preinstalled here, on GitHub - feel free to send us a Pull Request if you'd want to add a new preinstalled package!), or outdated.

We update the preinstalled Android packages on every weekend, so if the error is related to an outdated package, the workaround we describe here can be removed from your build after that weekend's update.

How to fix these errors?

It's quite simple, you just have to update or install the related Android package. You can do this with a Script step (can be the first step in the Workflow), just specify this as the content of the Script step to update the packages related to the errors above:


#!/bin/bash
# fail if any commands fails 
set -e 
# debug log 
set -x

# write your script here 
echo y | android update sdk --no-ui --all --filter extra-android-support | grep 'package installed' 
echo y | android update sdk --no-ui --all --filter extra-android-m2repository | grep 'package installed'
echo y | android update sdk --no-ui --all --filter extra-google-m2repository | grep 'package installed'
Copy code


Happy Building! 🚀

No items found.
The Mobile DevOps Newsletter

Explore more topics

App Development

Learn how to optimize your mobile app deployment processes for iOS, Android, Flutter, ReactNative, and more

Bitrise & Community

Check out the latest from Bitrise and the community. Learn about the upcoming mobile events, employee spotlights, women in tech, and more

Mobile App Releases

Learn how to release faster, better apps on the App Store, Google Play Store, Huawei AppGallery, and other app stores

Mobile DevOps

Learn Mobile DevOps best practices such as DevOps for iOS, Android, and industry-specific DevOps tips for mobile engineers

Mobile Testing & Security

Learn how to optimize mobile testing and security — from automated security checks to robust mobile testing and more.

Product Updates

Check out the latest product updates from Bitrise — Build Insights updates, product news, and more.

The Mobile DevOps Newsletter

Join 1000s of your peers. Sign up to receive Mobile DevOps tips, news, and best practice guides once every two weeks.