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.
Related
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.
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 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.
Well I want to highlight this and bring it all in this thread, as the rest of threads did not have a concluded answer, so before skipping into them here are the threads I referred to:
Adt doesn't create default hello world but command line does
[solved ]Eclipse behaving differently while creating new project/activity
ADT has been behaving a bit weird since past few days. I keep my SDK always updated so I frequently Run the SDK manager and download all the updates. recently I noticed that if I create a new android app project it is not creating a default MainActivity even if I check that box, it does not create a Activity under src and more to annoy me, I wasnt able to refactor anything, so I realized that I had to update my Eclipse as after reading few posts, but now when I create every new project it creates an annoying appcompat_v7 project with EVERY project, say I create two new projects it creates appcompat_v7_2....this is driving me crazy and the new project library is the appcompat_v7 project. This is becoming annoying and no idea whats going on here !!!! What should I do...please rescue me ! Thanks in advance ....A screenshot to annoy u guys too ... :)
***************Current Alternative, not a solution***********************
As of 12/5/2014 with ADT 23.0.2 I dont see this issue anymore.
I have waited for an acceptable solution on this issue (as of now there is none), but one of the SO members directed me to this post https://code.google.com/p/android/issues/detail?id=66975. What I am doing is described in one of the solutions below, but for people who have come to this post, the alternative is to delete that ugly project(if you have more than one) which has been created and add up this one(appcompat_v7) as a library. So if you create another project and appcomat_v7_2...comes up delete that and point your project to the appcompat_v7, do the same for other projects too. This is not recommended for some reason though, but it worked well for me till now without issues. If anyone hits up with a solution please post it here.
****************Current Alternative, not a solution*****************************
the folder appcompat_v7 doesnt get created if i use
minSdkVersion="14"
Seems like it is a eclipse bug. What you need to do is go to properties in the of the Android Project and in the Android Section. Add the library appcompat_v7 and remove the appcompat_v_7_2 (duplicate). Then you can remove the appcompat_v7_2 as a eclipse project. All errors fixed.
Just a workaround.
The appcompat project is a library to support android's older versions. The support library was introduced by Google recently - I donĀ“t know in which Android version.
But the point is, this project is only created when you create an Android project to cross Android platforms. I mean, when you select an old min API, e.g. API 8 (Froyo), but target recently versions, your project must have the support library.
Anyway, the creation of appcompat_v7 project is some issue that has to be better configured by the eclipse plugin maintainers. However you can elegantly turn over this issue by targeting newer APIs and including in the build path the support library. This is more elegant than the others because it is better to you focus in only one android version when building your application, and when it is done, you have an authentic version of your app that you can use as a mold to support other versions, either older or newers.
Is it possible to create a new project without gradle support in Android Studio, i.e. likewise in Intellij IDEA IDE?
I found one way only: create new project with IDEA and reopen in AS :-(
Unfortunately, I don't know such preference or option in AS. If you found it, please comment.
ps.s Gradle is a big pain at least in current AS beta 0.8, I spent more than 80% work time to fight with it's fatal issues. I think Google team must make AS more and more friendly to developers, never used gradle.
As far as I understand android studio is dependent on gradle as the build engine, and therefore you couldn't create an android project without gradle support