简体   繁体   中英

Directories rendered as packages in Intellij Idea 13?

After a rebuild of my android project i saw that the src folder and other folders( assets , libs etc) have turned into packages.(Packages in Intellij have a folder icon with a ball inside it)

Due to this, I also got errors in all files inside src folder. (for example see SearchActivity.java , 1st line).

在此处输入图片说明

I am new to Intellij so apologies if this sounds rudimentary.

It looks like the Shopper folder has been set to being a source root, instead of the src folder. To fix, turn off Flatten Packages and Compact Empty Middle Packages, right-click on src , go to Mark Directory As, and then Sources Root. Then un-mark the project folder.

You can also do this from Project Settings.

从2019.2.2开始,最简单的方法是执行File > Project Structure... ,双击Modules ,然后在Sources选项卡下右键单击该文件夹并将其取消标记为源文件夹。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM