首页 > 解决方案 > Android-support-v4 library doesn't have JobIntentService in B4A

问题描述

I have a library and it depends on Android-support-v4 (The JobIntentService class). I'm going to use it in Basic4Android.

There are two ways of adding supprt-v4 dependency to project:

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.

If I use the first way, I can't find JobIntentService. If I use the second way it's fine, but It will have a conflict with the AppCompat library.

So how an I have a complete code of support-v4 without experiencing conflicts?

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.

标签: androidbasic4android

解决方案


由于第一种方法使用Maven 工件Jcenter获取您的库,因此它可能会下载一个旧版本,该版本在其类路径中不包含此类。

要解决这个清晰的 B4A 库放置在m2repository 名为 sdk 的文件夹中b4a_remote,请将其删除并让 B4A 重新下载文件。因此,它将下载包含此类的最新和更新的库。


推荐阅读