I am using some old dependencies in my Android project. But now I am updating the dependencies to latest one. Before update how to check what are the changes is made in latest dependencies. Is there any tool or procedure to check the difference between two dependencies.
I am using 'com.squareup.okhttp3:logging-interceptor:3.12.3'. Now the latest version is 'com.squareup.okhttp3:logging-interceptor:4.10.0'. So before update I want to confirm that existing flow should not break. Many users are using my app. So please suggest me ideas to check the difference between two dependencies.
You can also check the changelog available here or on Github.
But in your case, when you're upgrading to the next major version, all libraries usually provide some kind of migration tutorial. For okHttp v3 -> v4 you'll find it here.
you can check the github page here and view differences between branches as there is a one for pretty much every version.
Related
I'm trying to use a library from GitHub in my Android Studio Project (specifically, the Universal Image Loader https://github.com/nostra13/Android-Universal-Image-Loader).
My project has been crashing, due to an error with a variable called mMaxHeight, in a file called ImageViewAware.java
On the GitHub page, I see that this issue was 4 fixed months ago:
When I view the code in ImageViewAware.java on GitHub, I see that the issue is fixed.
However when I look at the version of ImageViewAware.java being used in my Android Studio, I see it's an older version, with the issue not fixed.
I've added
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
to my Gradle Dependency, as the documentation says, and have followed all other instructions I can see.
I notice that the last update to those instructions was over a year ago. Should I be implementing a newer version than 1.9.5? Is there another reason why the version in my Android Studio isn't getting the latest GitHub version?
I'm pretty new to this and feeling a bit out of my depth. Thanks for any help!
Alex
You are correctly using the latest published version of the library, v1.9.5.
However, there have been 23 unreleased commits to that library since then, as shown on the GitHub tags page:
To get the latest version of the code, you'll need to:
Download the library's zip.
Unzip it.
Manually add the dependency to your project.
This process is pretty straightforward, you may also be interested in this list of every difference between v1.9.5 and master.
However, I'd recommend against using this library if possible, given that it hasn't had a release / major update in 4.5 years! In the readme the author states he has stopped maintaining it. It also has over 400 open issues, despite the popularity.
More modern libraries like Picasso and Glide are much more widely supported, feature rich, and reliable.
In the process of trying to fix a bug in my code, I migrated my android project to androidx and foolishly 'unchecked' the backup option before migrating when it popped up. Now, the androidx project is causing more issues than it is helping, and I realize that I may not be able to undo this action since I did not backup the previous version.
Is there a way for me to get my project back to the way it was pre-migration to androidx? I have a version on github that is pre-migration (I did not commit the changes to github after migrating to androidx), so if I uninstall and reinstall Android Studio and pull the project from github, will it undo the androidx changes?
Any help will be greatly appreciated! Thank you in advance.
Just revert the changes in version control. If you don't have such, revert the local history. While frankly speaking, when refactoring code, it is best to move forwards instead of backwards. As it is in this case ...else you won't ever get rid of the Jetifier, because one cannot mix appcompat with androidx. The reality is, that most current libraries meanwhile link against androidx.
You can try Refactor > Migrate to AppCompat...
But now AppCompat libraries are deprecated and there is no support from Google for it; so sooner or later you have to consider a migration plan.
I have published one library called SmartToolbar to jcenter successfully.
But I have one problem when I update it to new version and publish it again, it does not show suggestion message to update to new version in gradle.
Currently, the latest version of this library is 1.0.12, but as you can see in the screenshot, it doesn't show suggestion message to upgrade to version 1.0.12 as a library above it.
I want to fix it because I want to notify to all developers who are using it to get the latest update from my library.
NOTE: It does not show suggestion that have new version is available but we still get the latest update if we know the latest version. So only me that know about the latest version.n
When I publish new version I have updated the versionName which I create custom variable as PUBLISH_VERSION to use with my publish-android-library-plugin as bellow screenshot.
So I want to know more which part that I missed when I publish the new version?
or in my publish-android-library-plugin has something not correct? Maybe you need to review this raw code for checking my mistake.
NOTE: This library has synced to maven central
*UPDATE *
According to our dear friend JBaruch, he said:
The problem is that regardless of which repository your library is
resolved from (being it jcenter(), mavenCentral() or any other
repository), the check for the latest version is hardcoded to go
to Maven Central.
You can read more about his thoughts when answering a similar questions to yours over here: Add Warning "A newer version of ..... is available" for custom library
So, following his suggestion, you can try syncing your library with maven
* PREVIOUS ANSWER: I am leaving this here as I still think it is still important to understand the thinking process behind Android studio's aversion to getting the latest updates *
The version update popup notification is due to a Lint rule in Android Studio, called Newer Library Versions Available. According to How to check if gradle dependency has new version, the latest few updates to Android studio has modified that lint rule so users will no longer be notified of new non-Google library versions.
JBaruch's answer in How to check what is the latest version of a dependency to use in gradle gives a good reason why Google went with this change:
"Relying on latest version is indeed a dangerous thing to do. Your
build can break without you changing anything, just because some
library broke backwards compatibility."
Google would prefer developers stick to a particular library version and only update when required. So, checking for updates has become a manual process.
So, how can you proceed from here? If you just want to check that Android Studio is notified of your new library update, you can use Android Studio's proper method of checking for updates. You can look at Adam S's answer (the accepted one) in How to check if gradle dependency has new version for instructions to do the update check.
Given the recent updates I'm a little lost on what I should be using now.
I have been using gradle-experimental successfully but it still misses some of the build options default gradle has.
The gradle-experimental documentation has not been updated so it gives the impression that it is still necessary for ndk projects, but given how google do documentation it could just be out of date.
Any light cast on this would be very welcome and let me rest easy.
Thanks
In my project I am integrating push notification for that I require classes from com.google.android.gms package.
Is it possible for me to include selected package from whole library?
I am using eclipse. actually there are lot more libraries required, due to which I am facing 65k multidex issue. Any solution?
If you really really want to use the Eclipse to compile this, you need to perform these steps:
Have someone with Android studio include your needed Google components as dependency.
Kidnap the components from exploded-aar Android studio folder and setup the components as your own Eclipse library.
But of course, this is highly not a recommended procedure, but this is for those people who desperately needs it as last resort. This also marks a disclaimer that the kidnapped libraries are already free from the developer's accountability, because you didn't compile it the right way.
PS. Did this with Google Maps
If you want to use selective components of the Google Play Services you will need to switch to Android studio.
Read this: (Source)
Important: Support for the Android Developer Tools (ADT) in Eclipse
has ended, per our announcement. You should migrate your app
development projects to Android Studio as soon as possible. For more
information on transitioning to Android Studio, see Migrating from
Eclipse ADT.
If you still want to continue using eclipse, you'll have to to the hard work yourself - of deleting the unwanted packages/components from the full source code and making sure it compiles and works fine.
Instructions of setting up selective APIs can be found on this page, for android studio. For Eclipse, as the documentation says nothing about setting up selective APIs, you just have to go with the whole set.
NO. you have to migrate your code to Android Studio.