13

このトピックに関するいくつかの質問を見てきましたが、エラーの他の部分を検索しても何も見つからないため、完全な説明とともに質問を投稿することにしました。

私のコードではエラーは認識されません。どこにもない。すべてのライブラリが追加され、外部ライブラリ プロジェクトが正常にリンクされました。打ち上げで何かがうまくいかないという兆候はありません。

それでも、アプリケーションを起動すると (実行、コンパイル、ビルド (自動))、プロジェクトにエラーが含まれており、アプリケーションを再度起動する前にエラーを修正する必要があることを示すポップアップ メッセージが表示されます。

そこで、いくつかのプロパティをいじってみると、同僚は " Android Private Libraries" をチェックインする必要があることを発見しましたProperties -> Java Build Path -> Order and Export(以前、他のチェック ボックスと一緒にチェックを外したものもチェックしたことがあります)。しかし、アプリケーションを実行すると、同じポップアップが表示され、Consoleビューに次のように表示されます: (恐ろしいメッセージ)

[2013-06-22 20:55:03 - TheApplication] Dx 
trouble processing "java/sql/Savepoint.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.

[2013-06-22 20:55:03 - TheApplication] Dx 1 error; aborting
[2013-06-22 20:55:03 - TheApplication] Conversion to Dalvik format failed with error 1

以前にこのメッセージを受け取った人はいますか? なぜ私はそれを手に入れているのですか?私が気付いていないかもしれない「隠しライブラリ」や「内部ライブラリ」はどこで探せばよいのでしょうか?

私は上司と同僚に確認しました - 彼らはすべてプロジェクトに同じライブラリを持っています (私たちは一緒に作業しているので、明らかに同じものを持っている必要があります)。では、この問題を解決するにはどこに行けばよいのでしょうか?

4

3 に答える 3

15

プロジェクトとライブラリの「注文とエクスポート」タブでandroid.jarを削除することを解決しました。

于 2013-06-25T22:05:05.483 に答える
4

以前にこのメッセージを受け取った人はいますか?

はい。ただし、2009 年以降ではありません。

なぜ私はそれを手に入れているのですか?

プロジェクトのソース コードまたは JAR にはjava.sql.Savepoint、Android ランタイムから取得したもの以外に、インターフェイスの別のコピーがあるためです。

私が気付いていないかもしれない「隠しライブラリ」や「内部ライブラリ」はどこで探せばよいのでしょうか?

Eclipse クラスパス。ビルド パス ダイアログの [注文とエクスポート] 画面のスクリーンショットを使用して質問を編集することもできます。

于 2013-06-22T19:13:18.103 に答える