我已经导入了一个项目到Android工作室的几个子项目。
我想运行一个子项目。
我成功地完成了这个子项目的构建。Gradle作为一个模块。
为了运行它,我去运行>编辑配置> + > Android应用程序。
问题:当我尝试选择一个模块时,下拉列表中没有显示。
为什么会这样?
编辑:它在Groovy下显示为一个模块,但在Android应用程序下不显示。我如何让它显示在Android应用程序?
我已经导入了一个项目到Android工作室的几个子项目。
我想运行一个子项目。
我成功地完成了这个子项目的构建。Gradle作为一个模块。
为了运行它,我去运行>编辑配置> + > Android应用程序。
问题:当我尝试选择一个模块时,下拉列表中没有显示。
为什么会这样?
编辑:它在Groovy下显示为一个模块,但在Android应用程序下不显示。我如何让它显示在Android应用程序?
当前回答
对于我来说,我是一个新手,我搞砸了我的项目,不知道怎么回事,但它不会再运行,并抱怨清单,R,一切。我在我的设定中意识到这一点。gradle没有包含“:app”,一旦我添加了这个,我就回到了我的方式。
其他回答
似乎不同的解决方案适用于不同的人,对我来说,只是关闭项目并重新导入就解决了问题。
这些类型的问题与AndroidManifest.xml有关, 所以请检查AndroidManifest文件中的bug。
Try,
用Gradle文件同步项目 或 Files >同步文件系统 应该能行。
我通过以下方法在Android Studio 1.3.1中修复了这个问题:
Make a new module from File -> New -> New Module Name it something different, e.g. 'My Libary' Copy an .iml file from an existing library module and change the name of the file and rename references in the .iml file Add the module name to settings.gradle Add the module dependency in your app's build.gradle file 'compile project(':mylibrary')' Close and reopen Android Studio Verify that Android Studio recognises the module as a library (should be bold) Rename module's directory and module name by right clicking on the newly created module. Enjoy :)
在模块设置对话框中删除并重新添加Android和Android- gradle facet后,我修复了这个问题。