Missing runtime dependencies with owner, gradle for android

自闭症网瘾萝莉.ら 提交于 2019-12-08 08:03:36

问题


I have a multi-module setup in Android Studio that consists of one pure java module that is used to communicate with an API, and one Android project that makes use of that API-module. To configure API variables such as usernames and password I use Owner (http://owner.aeonbits.org/). The whole thing builds without problems.

I use a Main-function in the API module to test that things work well, which they do. There. My problem is that when I try to run the Android project with the compile dependency on the APi-module it crashes with the folling message:

  java.lang.NoClassDefFoundError: java.beans.PropertyEditorManager
        at org.aeonbits.owner.Converters$4.tryConvert(Converters.java:147)
        at org.aeonbits.owner.Converters.doConvert(Converters.java:227)
        at org.aeonbits.owner.Converters.convert(Converters.java:222)
        at org.aeonbits.owner.PropertiesInvocationHandler.resolveProperty(PropertiesInvocationHandler.java:83)
        at org.aeonbits.owner.PropertiesInvocationHandler.invoke(PropertiesInvocationHandler.java:54)
        at $Proxy2.local_server_url(Native Method)
        at se.springworks.api.client.M2HClient.<init>(M2HClient.java:40)
        at se.springworks.apiexample.androidexampleapp.ExampleActivity.onCreate(ExampleActivity.java:18)
        at android.app.Activity.performCreate(Activity.java:5426)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
        at android.app.ActivityThread.access$900(ActivityThread.java:161)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:157)
        at android.app.ActivityThread.main(ActivityThread.java:5356)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
        at dalvik.system.NativeStart.main(Native Method)

I have no idea why this isn't working but a wild stab is that not all of the dependencies from Owner get included in the Android project for some reason.

EDIT: Since this fails during runtime, I'm wondering if I have to do anything extra to add this as a runtime dependency aswell.


回答1:


There's no java.beans.PropertyEditorManager on Android. You can see what's supported from that package in the Android API Javadocs here:

http://developer.android.com/reference/java/beans/package-summary.html




回答2:


Latest versions (1.0.5.1 and above) should work fine.



来源:https://stackoverflow.com/questions/22988376/missing-runtime-dependencies-with-owner-gradle-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!