移动Android Studio项目会导致错误 [英] Moving an Android Studio project causes an error
问题描述
我将使用Gradle的Android Studio项目从D:\old\file\path
移到了D:\new\file\path
,现在出现以下错误:
I moved an Android Studio project that used Gradle from D:\old\file\path
to D:\new\file\path
and now I'm getting the following error:
Installation failed with message Invalid File: D:\old\file\path\app\build\intermediates\split-apk\debug\slices\slice_8.apk
我尝试从手机上卸载该应用程序,但仍然遇到相同的错误.我也尝试了一个仿真器,但是那也不起作用.
I tried uninstalling the app from my phone and still got the same error. I also tried an emulator but that didn't work either.
推荐答案
关闭项目.使用系统文件管理器,删除项目文件夹中的所有.iml
文件(可能是几个文件,两个或三个).这是您指导自己的A.S.忘记旧的路径.
Close your project. Using your system file manager, delete all .iml
files you have inside your project folder (probably this will be few files, two or three). This is the point where you instruct your A.S. to forget the older path.
然后导入-未打开-在Android Studio的全新窗口中导入项目.
Then import - not open - import your project on a brand new window of your Android Studio.
在File
菜单中,使用Invalidate caches and restart
.清除Build并再次运行.
From the File
menu, use Invalidate caches and restart
. Clean Build and run again.
这篇关于移动Android Studio项目会导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!