简体   繁体   English

Android-support-v4 库在 B4A 中没有 JobIntentService

[英]Android-support-v4 library doesn't have JobIntentService in B4A

I have a library and it depends on Android-support-v4 (The JobIntentService class).我有一个库,它依赖于Android-support-v4JobIntentService类)。 I'm going to use it in Basic4Android.我将在 Basic4Android 中使用它。

There are two ways of adding supprt-v4 dependency to project:有两种方法可以将supprt-v4依赖项添加到项目中:

  • Add添加
    <dependsOn>com.android.support:support-v4</dependsOn>
    to library xml.到库 xml。
  • Add添加
dependsOn>support-annotations</dependsOn>
<dependsOn>support-compat</dependsOn>
<dependsOn>support-v4</dependsOn>
<dependsOn>support-core-ui</dependsOn>
<dependsOn>support-core-utils</dependsOn>
<dependsOn>support-fragment</dependsOn>
<dependsOn>support-media-compat</dependsOn>

to that xml.到那个 xml。

If I use the first way, I can't find JobIntentService .如果我使用第一种方式,我找不到JobIntentService If I use the second way it's fine, but It will have a conflict with the AppCompat library.如果我使用第二种方式就好了,但是它会与 AppCompat 库发生冲突。

So how an I have a complete code of support-v4 without experiencing conflicts?那么我如何在不遇到冲突的情况下拥有完整的 support-v4 代码呢?

I know that JobIntentService exists in support-compat part of android-support-v4, but adding it beside com.android.support:support-v4 still causes duplications.我知道JobIntentService存在于 android-support-v4 的support-compat部分,但是将它添加到com.android.support:support-v4旁边仍然会导致重复。

Since the first way uses Maven artifacts to get your library from Jcenter , it might download an old version that does not include this class in it's class path.由于第一种方法使用Maven 工件Jcenter获取您的库,因此它可能会下载一个旧版本,它的类路径中不包含此类

To resolve this clear libraries of B4A placed in the sdk m2repository folder named b4a_remote , delete it and let the B4A redownload the files.要解决放置在名为b4a_remote的 sdk m2repository文件夹中的m2repository清除库,请将其删除并让 B4A 重新下载文件。 Therefore it will download fresh and updated libraries that contain this class.因此,它将下载包含此类的全新和更新的库。

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

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