0

I'm currently building an app that has to interact with a server. I have some classes that are defined in the server that I need to use in my app. I've tried the following to import my classes.

  1. Add the server project as a library for my app project
  2. Export my server project into a jar file and then copy it to my app project and make it its library.

Both methods allowed me to not have any compile time errors, however, when running the app, whenever the app uses one of the classes referenced from server project it will crash.

I debugged and whenever I get to the class (of the server) it would jump to Engine.class in the method onTickUpdate() and then crash.

Any ideas?

4

1 に答える 1

1

サーバー ライブラリが、Android プロジェクトからエクスポートしていない他の Java ライブラリを使用している可能性があります。

ビルド パスにこれらのライブラリがあるため、コンパイル時にはすべて正常に動作しますが、dex コンパイラは、エクスポート用に明示的にマークしたクラスのみをエクスポートします。

アプリのクラッシュの原因となっている参照を確認し、apk からクラス ファイルを抽出し、そのクラスが存在するかどうかを確認することができます。

于 2012-10-19T09:05:59.377 に答える