Tek Eye Logo

Tek Eye

Opening Pre-Android Studio 3 Projects

The Android Operating System (OS) is constantly evolving due to bug fixes, security updates, new Android versions and features, and support for new hardware. This means updates to the Android Software Development Kit (SDK) and the Android Studio Integrated Development Environment (IDE) happen often.

Each release or update to Android Studio brings changes that can affect existing projects. These changes can affect the build tools, Gradle based build system configuration, the Studio IDE, and the installed libraries. This can impact previous projects. This may mean that a project that opened, built and ran in a previous version of Studio now shows error messages and may fail to build in a newer version of Studio. This article gives some help in fixing issues that occur when opening previous Android projects in a new version of Android Studio.

Android Studio Starting

Checking the Studio Status Bar

Tip: When Android Studio is performing an action on a project the bottom status bar will show messages. This is useful to see if an action is being performed and you need to wait for it to finish before continuing.

Studio Status Bar

Gradle Sync Message

When opening a project after a Studio update, Studio may display the message: Gradle settings for this project are not configured yet.

Gradle Settings not Configured

Click OK for Studio to automatically perform the Gradle configuration.

Removing buildToolsVersion from build.gradle

The Studio Gradle build tools now default to a specific version. Therefore, the build.gradle for the app does not need the buildToolsVersion line. A message will displayed to indicate this:

Android Build Tools Version Message

To fix this message delete the buildToolsVersion line from the app's build.gradle file. The project can then be synced with the updated build.gradle. Use the Sync Project with Gradle Files option under Android from the Tools menu.

Viewing Installed Build Tools Versions

To see the build tools installed use the SDK Manager, opened via the toolbar icon.

Open SDK Manager

Use the SDK Tools tab and the Show Package Details check box to see the Build Tools versions installed.

Android Build Tools Versions

This is reflected in the build-tools directory under the Android SDK install location.

Android Build Tools Location

SDK Version Numbers

Opening projects in newer versions of Studio may require updates to the minSdkVersion and targetSdkVersion settings if libraries drop support for older versions of Android. For example at the time of writing Admob for Android only supports Android API 14 (Ice Cream Sandwich) and later. This means minSdkVersion would need setting to 14. Likewise to support new Android Oreo (API 26) features the targetSdkVersion is set to at least 26. The minSdkVersion and targetSdkVersion are changed in the app's build.gradle file. Again use the Sync Project with Gradle Files option under Android from the Tools menu when the SDK version values are changed.

Mike Bugdroid the Android Logo

See Also

Author:  Published:  

ShareSubmit to TwitterSubmit to FacebookSubmit to Google+Submit to LinkedInSubmit to redditPrint Page

markdown CMS Small Logo Icon ↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.

Articles on:

Android, HTML, VPS, Computing, IT, Computer History, ↓markdown↓ CMS

Free Android Projects and Samples:

Android Examples, Android List Examples, Android UI Examples