android 4.1.2下的应用在2.3.4上报错
来源:互联网 发布:显微图像软件 编辑:程序博客网 时间:2024/06/06 14:25
将4.1.2下正常运行的应用程序放在2.3.4的设备上报错:
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.app.appname/org.app.appname.gui.MainActivity}: java.lang.IllegalStateException: You must use Theme.Sherlock, Theme.Sherlock.Light, Theme.Sherlock.Light.DarkActionBar, or a derivative.
从该错误日志,怀疑两个点
1. Unable to start activity ComponentInfo
网上说是activity路径不正确,建议将相对路径改为绝对路径,比如将 .MainActivity 改为org.app.appname.gui.MainActivity, 改后无效。
2. 第二个点:You must use Theme.Sherlock.......
经检查确实是Theme没有识别,原来是 res/values/styles.xml 将中定义的name与 AndroidManifiest.xml 中引用的不一致所致,具体为:
在 AndroidManifiest.xml :
android:theme="@style/Theme.NameDiff 但应该是 android:theme="@style/Theme.Name
因为在 res/values/styles.xml的定义如下:
<style name="Theme.Name" parent="Theme.Sherlock">
官方知识点参考: http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme
但很奇怪的是,上述错误引用的theme,居然在4.1.2下没有问题。
- android 4.1.2下的应用在2.3.4上报错
- ffmpeg4mobile在mobile 6.1上报错“不是有效的Pocket PC应用”解决方法
- Unity3D在WebPlayer模式下的异常上报探索
- Unity3D在WebPlayer模式下的异常上报探索
- android 彩信发送,在部分手机上报错,提示activityNotFoundError。
- JsonKit 在xcode5 上报错
- Cocoapods在OS X Yosemite上报错的解决方法
- Cocoapods在OS X Yosemite上报错的解决方法
- Cocoapods在OS X Yosemite上报错的解决方法
- Cocoapods在OS X Yosemite上报错的解决方法
- OracleDatabase安装在Linux上报错pdksh的问题
- OracleDatabase安装在Linux上报错pdksh的问题
- Android 4G专网模块信号的上报过程
- 在Android下调试Unity3D的应用
- 解决Ext在IE9上报错,createContextualFragment
- soapui 在linux服务器上报错解决方法
- 解决Ext在IE9上报错,createContextualFragment
- Android程序Crash时的异常上报
- PHP数学运算: 向上/向下取整及四舍五入
- yii bootstrap
- 在 Eclipse 中使用 5 个有用的插件来自动化代码质量分析
- android nfc 开发
- 工厂方法模式
- android 4.1.2下的应用在2.3.4上报错
- 最优化算法:梯度下降与L_BFGS
- java.lang.IllegalArgumentException: View not attached to window manager when dismissing dialog
- Thinking in Java之接口回调改版
- vc6 编译boost
- logistical regression
- IE下,文字不自动换行
- oracle的jdbc连接方式:oci和thin
- eclipse如何把多个项目放在一个文件夹下