DEV Community

Evan Lin
Evan Lin

Posted on • Originally published at evanlin.com on

[TIL][Android] Common Android Studio Project Opening Issues

title: [TIL][Android] Problems that may be encountered when opening an Android Studio project
published: false
date: 2021-04-24 00:00:00 UTC
tags: 
canonical_url: http://www.evanlin.com/android-old-project/
Enter fullscreen mode Exit fullscreen mode

Preface:

Recently, Google Taiwan launched a project "Android App Development Training Program 2021", using Android Studio and the Kotlin language to help everyone write Android Apps. Although I've written before, I haven't used Android Studio for a long time, so let's open a project and see. But at first, it seemed like I opened the wrong codelabs www and accidentally opened the later Use Kotlin Coroutines in your Android App, and some problems occurred, which I'll solve as well.

How to set up the environment (How to setup your Android 4.1 on Mac Catalina)

Following this Kotlin coroutine codelab, you'll find where to download Android Studio. You'll also find the related github for Kotlin coroutine. Then, by opening the coroutines-codelab folder through Android Studio, you might encounter the following Error.

> License for package Android SDK Build-Tools 29.0.2 not accepted
> License for package Android SDK Platform 29 not accepted.

> Could not resolve all dependencies for configuration ':start:debugRuntimeClasspath'.
> Could not create task ':start:minifyReleaseWithR8'.
> Cannot query the value of this provider because it has no value available.

Enter fullscreen mode Exit fullscreen mode

Reason:

Because the latest version of Android Studio 4.1.3, the default Android SDK version is 30, but this codelab is prepared using the older version 29. Therefore, you need to download the older version of the SDK and agree to the relevant License authorization.

Solution:

[Preference] -> [System Setting] -> [Android SDK] -> Enable Android Platform 29

This way, when downloading Android SDK 29, it will also agree to the License. Then you can compile normally. The example can also run normally on the Android Simulator.

Related Articles:

Top comments (0)