Java Android Studio 设计编辑器在项目同步成功后才可用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/53195701/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android studio design editor is unavailable until after a successful project sync
提问by Eman Fateen
what is the actual root cause of this issue? I already sync with gradle files but eventually failed.
这个问题的真正根本原因是什么?我已经与 gradle 文件同步,但最终失败了。
采纳答案by Ridha Rezzag
Just sync your project with gradles. File --> Sync Project with Gradle Files
只需将您的项目与 gradle 同步。文件 --> 将项目与 Gradle 文件同步
回答by Prasad Jayathilake
Issue happened to me when I changed the res>values>styles.xml
当我更改时,问题发生在我身上 res>values>styles.xml
What I change was"Theme.AppCompat.Light.DarkActionBar"
--->>> "Base.Theme.AppCompat.Light.DarkActionBar"
我改变的是"Theme.AppCompat.Light.DarkActionBar"
--->>>"Base.Theme.AppCompat.Light.DarkActionBar"
Solutions I tried.
我试过的解决方案。
- Build -> Rebuild Project (Not worked)
- Close all files and Open again. Then Build -> Clean Project (Not worked) File -> Sync project with gradle files (Not worked)
- Close the Android Studio while project still opened. Opened it again. - It Worked.
- 构建 -> 重建项目(无效)
- 关闭所有文件并再次打开。然后 Build -> Clean Project (Not work) File -> Sync project with gradle files (Not work)
- 在项目仍处于打开状态时关闭 Android Studio。又打开了。- 有效。
回答by Abdullah Almasud
- Build -> Clean Project
- Build -> Rebuild Project
File -> Sync project with gradle files . If not worked then try
File -> Invalidate Caches / Restart .
- 构建 -> 清理项目
- 构建 -> 重建项目
文件 -> 将项目与 gradle 文件同步。如果不起作用,请尝试
File -> Invalidate Caches / Restart 。
It's work for me !!!
这对我有用!!!
回答by cesards
That could be fixed in one or two steps, depending on how nice is Android Studio today:
这可以通过一两个步骤来解决,具体取决于今天的 Android Studio 有多好:
- Try to sync your project with gradle files:
- 尝试将您的项目与 gradle 文件同步:
- If that doesn't work, invalidate Android Studio caches and restart. That should fix the problem:
- 如果这不起作用,请使 Android Studio 缓存无效并重新启动。这应该可以解决问题:
The reason behind the first solution not working could be related on gradle cached dependencies problems, but who knows
第一个解决方案不起作用的原因可能与 gradle 缓存依赖项问题有关,但谁知道
回答by Moment Mnt
Just you have to do >> open File --> Sync Project with Gradle Files and then after >> open File --> invalidate Android Studio caches / restart so done this problem.:)
只是你必须做 >> 打开文件 --> 将项目与 Gradle 文件同步,然后在 >> 打开文件 --> 使 Android Studio 缓存无效/重新启动,这样就解决了这个问题。:)
回答by ABHISHEK RAJ
If nothing of the above steps work, Then simply undo the changes that you have recently made, and then build gradle. In my case, I have added one dependencies and this problem raised, so I removed that dependencies build the gradle and then again add it. Problem Solved..!!
如果以上步骤都不起作用,那么只需撤消您最近所做的更改,然后构建 gradle。就我而言,我添加了一个依赖项并引发了此问题,因此我删除了该依赖项构建了 gradle,然后再次添加它。问题解决了..!!