简体   繁体   中英

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:

  • Add
    <dependsOn>com.android.support:support-v4</dependsOn>
    to library 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.

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.

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.

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. Therefore it will download fresh and updated libraries that contain this class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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