Problems
When building you might run into
the Unable to get buffer of resource asset file error. The root cause of
this is that the new android resource file resources.arsc is larger
than the aapt tool allows. You can exchange the .arsc file inside
android.jar with an older version or patch the aapt tool by editing
frameworks/base/include/utils/Asset.h.
Change both lines
UNCOMPRESS_DATA_MAX = 1 * 1024 * 1024 to something bigger. As the new
resources file currently has a size of 2.3Mb you should change the lines
(both lines mind you) to at least 3*1024*1024.
在使用linux下面默认选项build出来的SDK作开发时候,出现了以下问题:
...Unable to get
buffer of resource asset file
[2010-12-31 21:33:29 - s] W/ResourceType(27930): Unable to get buffer of resource asset file
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/res/layout/main.xml:2: error: No resource identifier found for attribute 'orientation' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/res/layout/main.xml:2: error: No resource identifier found for attribute 'layout_width' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/res/layout/main.xml:2: error: No resource identifier found for attribute 'layout_height' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/res/layout/main.xml:7: error: No resource identifier found for attribute 'layout_width' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/res/layout/main.xml:7: error: No resource identifier found for attribute 'layout_height' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/res/layout/main.xml:7: error: No resource identifier found for attribute 'text' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/AndroidManifest.xml:2: error: No resource identifier found for attribute 'versionCode' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/AndroidManifest.xml:2: error: No resource identifier found for attribute 'versionName' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/AndroidManifest.xml:6: error: No resource identifier found for attribute 'icon' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/AndroidManifest.xml:6: error: No resource identifier found for attribute 'label' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/AndroidManifest.xml:7: error: No resource identifier found for attribute 'name' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/AndroidManifest.xml:7: error: No resource identifier found for attribute 'label' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/AndroidManifest.xml:10: error: No resource identifier found for attribute 'name' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/AndroidManifest.xml:11: error: No resource identifier found for attribute 'name' in package 'android'
[2010-12-31 21:33:29 - s] /home/xiongmc/workspace/s/AndroidManifest.xml:16: error: No resource identifier found for attribute 'minSdkVersion' in package 'android'
解决办法是将build sdk时候的product该为sdk,有两种方法
:
1.
使用lunch更改配置:
cd ~/android/src
. build/envsetup.sh
lunch
sdk-eng
make sdk
配置之后的结果是:
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=1.6
TARGET_PRODUCT=sdk
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=Donut
============================================
2.
直接用make参数:
make PRODUCT-sdk-sdk
Asset限制文件大小UNCOMPRESS为1MB
在使用Android自带的
Res\raw或使用Asset时都需要经过Asset
Manager,这将会产生一个比较严重的问题,在Android模拟器测试时不存在问题,但放到真机G1时会面临多个问题,经过查看
UNCOMPRESS_DATA_MAX的取值为1048576字节,除以1024不难发现是1MB。也就是说Android手机在处理资源文件时不能大
于1mb的体积。由于标准的G1没有Root权限,无法访问data/data/package
name下面的文件夹,使用raw或asset存放的文件大小不能超过1048576字节,否则会在logcat下看到获取到Debug类型的信
息,tag为asset(pid): Data exceeds UNCOMPRESS_DATA_MAX (2580997 vs 1048576)
可以看到接下产生了一个系统的错误,System.err,会发生java.io.IOException的异常。
目前解决的方法只
有将文件放入到sdcard,但这样除了microsd的读取IO效率和耗电量解决不是很好,同时sd卡移除时可能存在问题,解决的方法如果数据量大的化
通过sqlite是一种解决方法,同时openFileOutput方式读取也是不错的选择,看来android操作系统中最安全控制的严格,但犯了一个
不小的错误。
分享到:
相关推荐
Android 材质资源 Android Material Design 资源 res/values/colors.xml 列出的所有材料颜色。 color.xml 是通过使用解析 html 生成的。
静态文件访问不到报No 'Access-Control-Allow-Origin' header is present on the requested resource处理办法
ilib-loctool-webos-json-resource ilib-loctool-webos-json-resource是loctool的插件,允许它读取和本地化JSON资源文件。 该插件针对webOS平台进行了优化。发行说明v1.3.3 已将美国英语翻译数据更改为位于资源根...
Rundeck PuppetDB节点插件 这是 2.5+的,为您的Rundeck服务器提供PuppetDB节点。 建造 gradle build 安装 将rundeck-puppetdb-nodes-plugin-XXX.jar文件复制到Rundeck安装中的libext/目录中。...resourc
jsr是Java Specification Requests的缩写,意思是Java 规范提案。
java8 看不到源码这是给班级的作业。 作业 7:复合和观察者 在本次作业中,您将 发现模型-视图-控制器 (MVC) 方法 使用 ...在一天结束时,您将实现一个小应用程序,用于检索自助餐厅的当前用餐计划。...resourc
文件上传下载....server-----------------javax.servlet-api-3.1.0.jar测试:------------------junit-4.5.jar}项目结构代码结构页面资源结构pages:页面相关 (以功能模块进行文件分隔操作)resourc
1.安装或导入vue-resource 安装命令: npm install vue-resource 导入: import VueResource from 'vue-resource' Vue.use(VueResource) 2.使用 格式: this.http.get('/url',[options]).then(successCallback,...
XN Resource Editor Source Code
这里为你收集整理了关于AI,机器学习,深度学习相关的资料一份,质量非常高,如果你投入时间去研究几天相信肯定对你有很大的帮助。到时候你会回来感谢我的。 本资源是经过本地编译测试、可打开、可运行的文件或源码...
使用一种语言的多个Resource.resx文件(资源管理器)进行WPF本地化。 如果只想对文本进行本地化,而发现太大而不能满足您的需要,则可以将其用作“一个文件”替代方案,它可以对字符串(而不是图像)进行本地化。 它...
测试中不需要属性,也不需要在应用程序包中,但是如果您决定将应用程序与属性文件打包在一起,则需要将其放置在以下路径下:$(PROJECT_ROOT_DIRECTORY)/aic2014 -gr3-topic4-twitter/src/main/resourc
Connect 应用程序的遍历。 v0.3.4 connect-traversal 是 Connect 和 Express 框架的中间件,它允许使用 URL 遍历而不是 URL 调度。 遍历机制比 URL 调度更强大,并在 Rails (Ruby)、Pyramid ...resource: resourc
s3-nginx-proxy 一个功能丰富的基于Amazon S3 NGINX的代理,可在Docker和Kubernetes中运行。特征对专用存储桶的身份验证多个水桶每个存储桶多个域多个地区共享缓存每次配置更新后自动...: " s3:GetObject " , " Resourc
适用于OpenUI 5的Chart.js 描述 该项目的目标是基于创建一个UI5库,该库具有与Chart.js相同的模型。 使模型与Chart.js相同的主要原因是: 您可以通过参考Chart.js文档来使用此库。... data-sap-ui-resourc
头盔补丁插件 概述 这个插件可以帮助修复某些头盔中的头盔3图表,其中默认头盔3可能会有困难。 补丁API更改 在升级k2s集群期间,资源的... helm patch adopt <release> <chart> --kind resource-kind --name resourc
CRM(客户关系管理)是个高度复杂的系统,在这里将要实现的是一个适用于中小企业的客户资源管理系统,提供了对客户资源的有效管理,而且还包含了丰富的查询和统计功能,能帮助中小企业管理好自己的客户资源。
personal photo
代码用扫描工具扫出来问题,发现是try-catch-finally的另一种写法try-with-resource,发现这种写法优雅,代码量减少1/3(finally里面不用写close)这样就看的不那么臃肿了。因为上传,下载的时候有可能会创建input ...