简体   繁体   English

缺少与所有者的运行时依赖关系,gradle for android

[英]Missing runtime dependencies with owner, gradle for android

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. 我在Android Studio中有一个多模块设置,包括一个用于与API通信的纯java模块,以及一个利用该API模块的Android项目。 To configure API variables such as usernames and password I use Owner ( http://owner.aeonbits.org/ ). 要配置API变量,例如用户名和密码,我使用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. 我在API模块中使用Main函数来测试它们是否正常工作。 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: 我的问题是,当我尝试在APi模块上运行具有编译依赖性的Android项目时,它会崩溃并显示以下消息:

  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. 我不知道为什么这不起作用,但狂野的一点是,并非所有来自所有者的依赖项都出于某种原因包含在Android项目中。

EDIT: Since this fails during runtime, I'm wondering if I have to do anything extra to add this as a runtime dependency aswell. 编辑:由于这在运行时失败,我想知道我是否必须做任何额外的事情来添加它作为运行时依赖项。

There's no java.beans.PropertyEditorManager on Android. Android上没有java.beans.PropertyEditorManager You can see what's supported from that package in the Android API Javadocs here: 您可以在此处查看Android API Javadocs中该软件包支持的内容:

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

最新版本(1.0.5.1及更高版本)应该可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM