So I am trying to use this library in my android app to be able to show pdf files. However, when I add the install line to my build.gradle file, Android Studio says that all Android support libraries should use the same version. This happens because the library uses com.android.support:support-compat:26.1.0 while my project is using com.android.support:appcompat-v7:28.0.0.
I want to know if there is a way to get around this and use the library in my project, or if I would have to fork and update the library myself to make it work.
Any help is appreciated.
simply exclude it from the build:
api ("com.github.barteksc:android-pdf-viewer:2.8.2") {
exclude group: "com.android.support", module: "appcompat-v7"
}
Related
I tried adding this dependency in gradle : 'com.stripe:stripe-android:17.1.1'
But this gave me this error :
So I changed my gradle dependency to
{implementation('com.stripe:stripe-android:17.1.1') { exclude group: "org.bouncycastle" }}
Now I'm able to build the project successfully . Is this workaround correct or will there be any issues in future when I use stripe SDK functions .
One library is using org.koin:koin-android:2.1.6 and other is using org.koin:koin-android:1.0.2.
Now if I use both of these libraries together, I get classDefNotFound.
If i force "2.1.6", second library starts crashing, and if i use "1.0.2" first starts crashing.
implementation('library') {
exclude group: 'org.koin', module: 'koin-android'
}
So exclude, force are not possible, as "koin" has added some new classes in their latest version.
What should be the solution in this case. Is it possible to keep different version of libraries, or define some kind of alias, so both libraries use their respective version without any issue.
This is the library I am using: https://github.com/ArthurHub/Android-Image-Cropper
The grade sync fails after adding it. Before that, there is no problem.
Apparently, the library you are using uses an older version of the support library v25.3.1, and it is conflicting with the one you have.
Try the following:
compile ('com.theartofdev.edmodo:android-image-cropper:2.4.+') {
exclude group: 'com.android.support'
}
However there are no guarantees that the library would work considering a different version.
We are working on an application (APP) that uses a local maven dependency library (LIB). LIB uses a custom .jar of OkHttp, and APP also uses OkHttp (not custom). When we try to build, we get a 'Multiple dex files define X' error, and enabling multiDex gives an error about a duplicate ZipException. APP is trying to refer to the OkHttp.jar in LIB, when we want it to not do that. And, well, we can't get it to work.
We've tried placing this in our APP gradle file with no luck:
compile(LIB) {
exclude group: 'com.squareup', module: 'okhttp';
}
And, unfortunately, we can't not use LIB. Thoughts? Also, gradle -q dependencies does not list any dependencies under LIB, but we know that it uses a compile file('CUSTOM_OKHTTP') line in its gradle.
I'm developing an android app using android studio as IDE.
My question is:
How to exclude certain files under certain directory during the process of building APK?
In my case, I want to exclude some images from building since the those files used in my project are designated to be downloaded from network in-app while during the development I hope to refer them in the layout.
After googling, I found some solutions:
Gradle 1.2: Exclude directory under resources sourceSets
How to exclude file from resources using Gradle and Android Studio?
And reference from gradle.org
Then I came up my solution in build.gradle:
sourceSets {
main {
resources.exclude '**/drawable/*'
res.exclude '**/drawable/*'
}
}
But it doesn't work, the image under res/drawable/ still shows up(before downloading).
The Android Studio version is currently 0.8.4.
Any idea would be appreciated.
Exclude paths aren't currently supported for Android sourceSets. You can track this at bug https://code.google.com/p/android/issues/detail?id=64957
This is happening because Android sourceSets aren't the same as Java sourceSets; they're a custom implementation in the Android plugin, and don't automatically pick up all the features of their cousins. This will need to be specially implemented for Android, and it hasn't been done yet.