2012-01-29 1 views
0

Из того, что я читал, эта ошибка может быть вызвана дублирующимися ссылками на классы, существующие в файлах diff jar, и это, казалось, было после того, как я возился с Путь сборки. НО, все, что у меня было, это android.jar и android-support-v4.jar на моем пути сборки и под ссылочными библиотеками, которые мне нужны, чтобы получить чистую сборку.Пробовал все - Конверсия в формат Dalvik не удалась с ошибкой 1

Я очистил проект, удалил R.java, закрыл и снова открыл проект, но я все еще получаю это сразу от ставки. Что еще я могу сделать, чтобы исправить это? Мне нужны оба файла .jar, и они единственные, включенные в мой проект.

Console Log:

 
[2012-01-29 13:05:30 - HelloFragmentLayout] Dx 
trouble processing "javax/security/auth/callback/PasswordCallback.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 
in your application's project, when using an IDE (such as 
Eclipse). If you are sure you're not intentionally defining a 
core class, then this is the most likely explanation of what's 
going on. 

However, you might actually be trying to define a class in a core 
namespace, the source of which you may have taken, for example, 
from a non-Android virtual machine project. This will most 
assuredly not work. At a minimum, it jeopardizes the 
compatibility of your app with future versions of the platform. 
It is also often of questionable legality. 

If you really intend to build a core library -- which is only 
appropriate as part of creating a full virtual machine 
distribution, as opposed to compiling an application -- then use 
the "--core-library" option to suppress this error message. 

If you go ahead and use "--core-library" but are in fact 
building an application, then be forewarned that your application 
will still fail to build or run, at some point. Please be 
prepared for angry customers who find, for example, that your 
application ceases to function once they upgrade their operating 
system. You will be to blame for this problem. 

If you are legitimately using some code that happens to be in a 
core package, then the easiest safe alternative you have is to 
repackage that code. That is, move the classes in question into 
your own package namespace. This means that they will never be in 
conflict with core system classes. JarJar is a tool that may help 
you in this endeavor. If you find that you cannot do this, then 
that is an indication that the path you are on will ultimately 
lead to pain, suffering, grief, and lamentation. 

[2012-01-29 13:05:30 - HelloFragmentLayout] Dx 1 error; aborting 
[2012-01-29 13:05:30 - HelloFragmentLayout] Conversion to Dalvik format failed with error 1 

ответ

0

У меня была такая же проблема при попытке запустить пример приложения, написанные для Android 3 под андроид 4. Я закомментированный тело каждого метода в каждом классе и попытался удалить android.jar из пути к классам, и я больше не получаю сообщение об ошибке. И он работает, даже когда я комментирую код, ранее не комментируемый ... странно :(К сожалению, я не уверен, что это подходящее решение, так как я получаю NPE при попытке запустить приложение, о котором идет речь. ?

0

Я столкнулся с одной и той же проблемой, и я понял, что дважды добавил библиотеку Android, а также среду JRE. Просто убедитесь, что Java-путь сборки проекта содержит только одну платформу Android, а не JRE.Это должно решить проблему.

0

Удалите любые другие библиотеки или файлы jar, которые вы можете использовать, помимо библиотеки Android. Возможно, вы можете использовать библиотеку Android, а также добавить банку для Android из «Добавить Jar ". Если это так, удалите дополнительную банку. После этого чистая сборка должна решить вашу проблему проблема.