[英]How to use classes from rt.jar in an android application?
I am building an android application that references an external library. 我正在构建一个引用外部库的android应用程序。 The problem is that library uses java.beans.PropertyDescriptor and this causes Dalvik exception at runtime.
问题在于该库使用java.beans.PropertyDescriptor,这在运行时导致Dalvik异常。
How can I solve this problem ? 我怎么解决这个问题 ? I found on another forum that it was possible to manipulate bytecode to load classes that are not known from Dalvik.
我在另一个论坛上发现可以操纵字节码来加载Dalvik未知的类。
Any suggestions ? 有什么建议么 ?
Thanks 谢谢
How can I solve this problem ?
我怎么解决这个问题 ?
Get the source code to the external library and rewrite it to avoid java.beans.PropertyDescriptor
. 将源代码获取到外部库,然后重写它以避免使用
java.beans.PropertyDescriptor
。
For example, you could: 例如,您可以:
java.beans.PropertyDescriptor
from someplace like Apache Harmony java.beans.PropertyDescriptor
的副本 java.beans.PropertyDescriptor
to some.other.package.PropertyDescriptor
java.beans.PropertyDescriptor
重构为some.other.package.PropertyDescriptor
some.other.package.PropertyDescriptor
to your project some.other.package.PropertyDescriptor
添加到您的项目 some.other.package.PropertyDescriptor
some.other.package.PropertyDescriptor
Bear in mind that there may be many other problems with this library, which apparently was not written with Android in mind. 请记住,此库可能还有许多其他问题,显然这些问题并不是在考虑Android的情况下编写的。
I found on another forum that it was possible to manipulate bytecode to load classes that are not known from Dalvik.
我在另一个论坛上发现可以操纵字节码来加载Dalvik未知的类。
Since there is no java.beans.PropertyDescriptor
on Android devices, this will not help you. 由于Android设备上没有
java.beans.PropertyDescriptor
,因此这对您没有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.