Skip to content
Advertisement

Android Studio – Error Module not specified

i’m a newbie to Android/Java development and purchased a book Java Programming for Android Developers For Dummies, 2nd Edition.

This comes with a code samples section http://users.drew.edu/bburd/Java4Android/ (chapter 02_01) I understand the book is a few years old hence so the code samples will be. However, i’m having massive problems getting the code samples to run on Android Studio 4.1.2.

I can import the project and sync the Gradle files. When I do it appears with a green tick at the bottom. Oddly it says failed next to that with the following message.

JavaScript

My build.gradle file is as follows

JavaScript

Also if I try and run the project I see this screen Error message

main screen

I’ve read many posts with similar issues and worked through various fixes. None seemed to work so can anyone shed any light on what’s happening please? I’ve also downloaded android studio on 3 different PC’s incase its a bug of some sort.

Thank you

Advertisement

Answer

I should say the files in there are very outdated, and you will have very hard time, with every project. But if you still want to build the project here are a few things you can do.

look for the file gradle-wrapper.properties and update it with this

JavaScript

Then move to project level build.gradle file (there are two one inside app directory and one on the root directory, use the root directory)

JavaScript

Then move to app level build.gradle and update it with this

JavaScript

And then sync the project and let Android studio do its magic.

Advertisement