Andrew Fletcher published: 22 July 2022 2 minutes read
Approaches to resolving “Module not specified” Error in Android Studio
When attempting to run or debug the application on Android Studio you can come across the error “Module not specified” in the Android Studio. This article will outline approaches I took to get a resolution to this issue.
Tools
Tool | Version |
---|---|
Android Studio | Chipmunk | 2021.2.1 |
OS | OSX - Big Sur 11.6.7 |
Ionic | CLI 6.20.1 |
Node | 18.0.0 |
Cordova | cli: 11.0.0 |
Method 1 - Synchronise the project
Let's start with resynchronising the project Gradle files to add the app module through Gradle. Use the following steps:
1. In the root folder of your project, open the settings.gradle file for editing
2. Delete the line include('app') from your file
3. Then in Android Studio, click File Menu > Sync Project with Gradle files
4. After step 3, Add again, include('app') to the settings.gradle file
5. Re-run Sync Project with Gradle files again
Re check the “Module not specified”. Still there? Go on to the next approach.
Method 2 - Import the project
Re import the project in to Android Studio
1. Close all the Android Studio projects
2. Remove the project from the recent projects in android studio wizard
3. Restart Android Studio
4. Select File > New > Import Project...
5. File > Sync project with gradle files
Method 3 - Clear the caches
In Android Studio clean the project and do invalidate caches/restart. To Invalidate Caches use the following path:
File > Invalidate Caches...
Then check
Clear file system cache and Local History
Clear VCS Log caches and indexes
Finally, click Invalidate and restart
Related articles
Andrew Fletcher
•
29 Sep 2024
Managing app versioning in Android Studio - simplifying versionCode, versionName, and versionNameSuffix
Versioning is an important aspect of any mobile app development process. In Android, this is handled through versionCode and versionName, which allow you to define the current state of your app for users and the Play Store. But where exactly should these be managed, and how can you ensure they...
Andrew Fletcher
•
31 Oct 2023
Android icon not changing
If the Android app icon is not changing from the default icon (in my situation this was the Capacitor icon), here are some steps to troubleshoot and resolve the issue: Check the Icon FilesEnsure that you have provided the correct icon files in the appropriate directory. In a Capacitor project,...
Andrew Fletcher
•
27 Oct 2023
Working through android.permission.REQUEST_INSTALL_PACKAGES blocking releases
I'm receiving an issue with a previous release on Google Playandroid.permission.REQUEST_INSTALL_PACKAGESI'm seeing the following message in Google PlayRequest install packages permission
error - Not started - Your app isn't compliant
A permission that allows your app to install packages. If your...