简体   繁体   中英

Android Studio will not run a project recently cloned from github, app.iml module not found

I have been having a lot of trouble cloning a project I made on my other computer onto a new computer in android studio, when first opening the project it prompts that it cant find some .iml modules but i checked in the folder and they are there. When I try to run, clean or build the app i get 2 exceptions thrown:

Error:java.io.FileNotFoundException: D:\\foo\\app\\build\\intermediates\\res\\merged\\debug\\drawable-xhdpi-v4\\abc_ic_star_black_16dp.png (The requested operation cannot be performed on a file with a user-mapped section open)

:app:mergeDebugResources , which gives me the same quote as above (The requested operation cannot be performed on a file with a user-mapped section open)

In the activities I also get an error everytime i try and reference the resource folder: Cannot resolve symbol "R"

I believe I am having the same problem as this person earlier this year, but I either did not follow the answers instructions properly or this doesnt work anymore. Can't import android project from git

The solution might be some change to the gitignore file I am using, here is my current gitignore: https://github.com/asdiamond/GodSpeedInvestmentApp/blob/master/.gitignore

I cloned you GodSppedInvestmentApp from github, using Android Studio to build and install it. It worked fine. So perhaps Android Studio drank too much, and it need to be kicked ass.

Delete the whole dir and re-clone it. If not help, try to update Android Studio to the last version.

Android Studio 2.2.2
MacBook Pro (Retina, 15-inch, Mid 2015)

It seems that as of android studio 2.2.3 this issue is still not fixed, although it is a known bug in android studio and NOT a bug from git. The only way to prevent this issue from affecting your projects is to ignore android studio's "Module not found, IDE Internal error occurred" message when opening your project. I've found if you don't click this message then you should be completely fine. I know this probably isn't the answer some people wanted as it doesn't fix the issue, but you can prevent it from affecting your project this way.

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