The module cannot be an Android library?

I am using IntelliJ IDEA for Android Development, and when I try to edit the launch configuration for the Android emulator, it says there is an error and it looks like this.

The emulator is still working, but it does not start the activity automatically, and I'm just wondering what causes this error and what are the possible solutions. Thank.

+5
source share
6 answers

"SpyMaze" seems to be an Android library project, so you cannot run the library project, check this out

+1
source

, Android Studio, "" "com.android.library" build.gradle.

, :

apply plugin: 'com.android.library'

:

apply plugin: 'com.android.application'
+2

" " ( , " " ), "" "Android" " ".

- > - > ANDROID- > UNCHECK

+1

, .

, SpyMaze build.gradle:

apply plugin: 'com.android.application'

SpyMaze ,

apply plugin: 'com.android.library'

And in the editing settings, select the main application. Therefore, you should see Run 'app', not Run 'SpyMaze'

+1
source

Also, if you added a new module / library, be sure to return to the correct project before clicking Run.

enter image description here

+1
source

For InstantApp- make sure that you run app, not just one of yours features. Select appin the Android Studio panel to launch.

0
source

All Articles