Android Studio Run/Debug configuration error: Module not specified

前端 未结 16 2592
[愿得一人]
[愿得一人] 2020-12-02 07:14

I am getting a \'Module not specified\' error in my run config. I have no module showing in the drop down yet I can see my module no probs. The issue came about when I refac

相关标签:
16条回答
  • 2020-12-02 07:41

    Resync your project gradle files to add the app module through Gradle

    1. In the root folder of your project, open the settings.gradle file for editing.

    2. Cut line include ':app' from the file.

    3. On Android Studio, click on the File Menu, and select Sync Project with Gradle files.

    4. After synchronisation, paste back line include ':app' to the settings.gradle file.

    5. Re-run Sync Project with Gradle files again.

    0 讨论(0)
  • 2020-12-02 07:42

    I struggled with this because I'm developing a library, and every now and then want to run it as an application.

    From app/build.gradle, check that you have apply plugin: 'com.android.application' instead of apply plugin: 'com.android.library'.

    You should also have this in app/build.gradle:

    defaultConfig { applicationId "com.your_company.your_application" ... }

    Finally run Gradle sync.

    0 讨论(0)
  • 2020-12-02 07:43

    I had to select "Use classpath of module:" drop down option and choose my module.

    0 讨论(0)
  • 2020-12-02 07:44

    never mind, i changed the name in settings.gradle and synced and then changed it back and synced again and it inexplicably worked this time.

    0 讨论(0)
  • 2020-12-02 07:44

    Run the app, it will show 'Edit Configuration' window. Under Module - select the app (it would be <no module> ).

    Then select the activity (under Launch Options)

    0 讨论(0)
  • 2020-12-02 07:49

    Remove from app gradle this code

    android{
        defaultConfig.applicationId="com.storiebox"
    }
    
    0 讨论(0)
提交回复
热议问题