eclipse 为“缺少样式。为此布局选择了正确的主题吗?”而苦恼。问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14299333/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:47:42  来源:igfitidea点击:

Struggling with "Missing styles. Is the correct theme chosen for this layout?" issue

androideclipseadtandroid-sdk-tools

提问by meeDamian

The issue I dislike a lot.So I'm trying to resolve this issue for most of today... What ever device/resolution/anything I choose it's displayed incorrectly, and looks like styles aren't loading...

我很不喜欢的问题。所以我今天大部分时间都在努力解决这个问题......我选择的任何设备/分辨率/任何东西都显示不正确,看起来样式没有加载......

Missing styles. Is the correct theme chosen for this layout?

Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Couldn't find theme resource for the current theme

缺少样式。是否为此布局选择了正确的主题?

使用布局上方的主题组合框选择不同的布局,或修复主题样式引用。找不到当前主题的主题资源

I tried:

我试过:

  • re-downloading & re-installing ADT
  • same with eclipse plugin
  • tried almost every combination of options in drop-down lists - none of them worked
  • tried re-adding project (from disk, from remote repository)
  • changing target in AndroidManifest.xml and in project properties
  • cleaning, building, running, anything that came to my mind or I could find on stackoverflow
  • restarting my computer (yes, 3 times), and eclipse
  • running it on other project, and sometimes it works fine there!
  • 重新下载并重新安装 ADT
  • 与eclipse插件相同
  • 尝试了下拉列表中几乎所有选项的组合 - 它们都不起作用
  • 尝试重新添加项目(从磁盘,从远程存储库)
  • 在 AndroidManifest.xml 和项目属性中更改目标
  • 清理、构建、运行,任何我想到的或者我可以在 stackoverflow 上找到的东西
  • 重新启动我的电脑(是的,3 次),然后 eclipse
  • 在其他项目上运行它,有时它在那里工作正常

I'm running on:

我正在运行:

  • Elementary OS (Ubuntu based) - Linux maurycy-EOS 3.2.0-35-generic#55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64x86_64 x86_64 GNU/Linux
  • Eclipse 4.2.1
  • Android SDK Tools 21.1 rc1(yes, it's a preview, but it's not working on 21.0.1too)
  • Android SDK Platform-tools 16.0.1
  • java version "1.7.0_09"; OpenJDK Runtime Environment (IcedTea7 2.3.3) (7u9-2.3.3-0ubuntu1~12.04.1); OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
  • 基本操作系统(基于 Ubuntu)- Linux maurycy-EOS 3.2.0-35-generic#55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64x86_64 x86_64 GNU/Linux
  • 日食4.2.1
  • Android SDK 工具21.1 rc1(是的,它是预览版,但它也不适用于21.0.1
  • Android SDK 平台工具16.0.1
  • java版本“ 1.7.0_09”;OpenJDK 运行时环境(IcedTea7 2.3.3)(7u9-2.3.3-0ubuntu1~12.04.1);OpenJDK 64 位服务器 VM(构建 23.2-b09,混合模式)

If anyone had similar issue, have any clue what might've caused that, or can help in any possible way, I'd be really glad to hear from you!

如果有人有类似的问题,知道可能是什么原因造成的,或者可以以任何可能的方式提供帮助,我很高兴收到您的来信!

It kinda looks like there's no styles installed on my machine :|

看起来我的机器上没有安装样式:|

If you think there's something wrong with my code, here it is: http://goo.gl/bbVdc

如果您认为我的代码有问题,请访问:http: //goo.gl/bbVdc

采纳答案by meeDamian

So turns out my problem was in my code. My problem was that I've been setting question markalone as a content of the string. And, as I was told, question mark is also the character which starts a theme reference.

结果证明我的问题出在我的代码中。我的问题是我一直将问号单独设置为字符串的内容。而且,正如我被告知的,问号也是开始主题参考的角色。

Other words, my problem was caused by android bug.

换句话说,我的问题是由android bug引起的。

edit:

编辑:

It's worth noting that this bug has been fixed since then, so if you're still having this problem try updating your adt.

值得注意的是,此错误已从那时起修复,因此如果您仍然遇到此问题,请尝试更新您的 adt