Java学习者论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

手机号码,快捷登录

恭喜Java学习者论坛(https://www.javaxxz.com)已经为数万Java学习者服务超过8年了!积累会员资料超过10000G+
成为本站VIP会员,下载本站10000G+会员资源,购买链接:点击进入购买VIP会员
JAVA高级面试进阶视频教程Java架构师系统进阶VIP课程

分布式高可用全栈开发微服务教程

Go语言视频零基础入门到精通

Java架构师3期(课件+源码)

Java开发全终端实战租房项目视频教程

SpringBoot2.X入门到高级使用教程

大数据培训第六期全套视频教程

深度学习(CNN RNN GAN)算法原理

Java亿级流量电商系统视频教程

互联网架构师视频教程

年薪50万Spark2.0从入门到精通

年薪50万!人工智能学习路线教程

年薪50万!大数据从入门到精通学习路线年薪50万!机器学习入门到精通视频教程
仿小米商城类app和小程序视频教程深度学习数据分析基础到实战最新黑马javaEE2.1就业课程从 0到JVM实战高手教程 MySQL入门到精通教程
查看: 886|回复: 0

Q&A: 关于conversion to dalvik format failed with error 1

[复制链接]

该用户从未签到

发表于 2011-10-22 18:43:54 | 显示全部楼层 |阅读模式
关于conversion to dalvik format failed with error 1

最近总是遇到这个问题,好几次了。今天终于找到原因了。真纠结啊。。。


trouble processing "java/nio/CharBuffer.class":
Ill-advised or mistaken usage of a core class (java.* or javax.*)     when not building a core
library.
This is often due to inadvertently including a core library file   
[apply] in your application's project, when using an IDE (such as   
[apply] Eclipse). If you are sure you're not intentionally defining a   
[apply] core class, then this is the most likely explanation of what's   
[apply] going on.

However, you might actually be trying to define a class in a core    [apply] namespace, the
source of which you may have taken, for example,    [apply] from a non-Android virtual machine
project. This will most    [apply] assuredly not work. At a minimum, it jeopardizes the   
[apply] compatibility of your app with future versions of the platform.    [apply] It is also
often of questionable legality.    [apply]     [apply] If you really intend to build a core
library -- which is only    [apply] appropriate as part of creating a full virtual machine   
[apply] distribution, as opposed to compiling an application -- then use    [apply] the "--
core-library" option to suppress this error message.    [apply]     [apply] If you go ahead
and use "--core-library" but are in fact    [apply] building an application, then be
forewarned that your application    [apply] will still fail to build or run, at some point.
Please be    [apply] prepared for angry customers who find, for example, that your    [apply]
application ceases to function once they upgrade their operating    [apply] system. You will
be to blame for this problem.    [apply]     [apply] If you are legitimately using some code
that happens to be in a    [apply] core package, then the easiest safe alternative you have is
to    [apply] repackage that code. That is, move the classes in question into    [apply] your
own package namespace. This means that they will never be in    [apply] conflict with core
system classes. JarJar is a tool that may help    [apply] you in this endeavor. If you find
that you cannot do this, then    [apply] that is an indication that the path you are on will
ultimately    [apply] lead to pain, suffering, grief, and lamentation.

这个错误是由于错误的添加了不必要的core library,我是多添加了Android.jar之后报错,把不要用掉的
包给去掉就好了。我本来把android.jar已经单独弄成了一个User Library了,最后还用add extenerl jar
的方式添加了它,所以错了,删除多余的android.jar就ok。下面是一些解决办法,我开始弄了一会,不行。

android低版本工程(如1.5)放到高版本环境中(如2.2)可能会上述错误,解决方法如下:
1。 如果不修改android sdk版本,则使用project clean 命令作用于某工程即可。
       (该处理方式只是在高版本中兼容了低版本工程,未真正意义上的升级)
2。 如果修改android sdk版本,则需要以下几个步骤:
       1)修改SDK
             选择工程,build path --> configure build path ---> library 删除引用的低版本SDK,
             然后add External JARs,选择高版本SDK,OK,保存
        2)修改classpath文件
             该文件可能存在该项: <classpathentry kind="lib"   path ="你所指定的高版本的地址"
             把她修改成<classpathentry kind="con"
path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK" />
        3) 修改AndroidManifest.xml
             在AndroidManifest.xml文件中,application标签后添加<uses-sdk
android:minSdkVersion="3"></uses-sdk>
        4) 修改default.properties(很重要)
              该文件最后一行(前面没用#的)target=android-3 该成target=android-8,保存。
        再看看你的工程和新建的android 2.2的工程结构就一样了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Java学习者论坛 ( 声明:本站资料整理自互联网,用于Java学习者交流学习使用,对资料版权不负任何法律责任,若有侵权请及时联系客服屏蔽删除 )

GMT+8, 2025-1-10 14:07 , Processed in 0.293706 second(s), 36 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表