I created two Android Studio applications. One of them is aar library. I used this aar library in second application. I added aar library by using File->New->New Module->Import AAR/JAR Packages option. after that I can see decompiled sources of my aar library. When I update aar library I copy and paste new aar file to my application project folder. But this time Android Studio shows older decompiled sources. But compile new source successfully. How can I update decompiled sources in Android Studio ? when I import aar file implementation project(':app-debug')
line was added my build.gradle
file.
I am using Android Studio 3.0.1
my solution
the only way I can find to update local sources is clicking Sync Project with Gradle Files button after updating aar/jar file.
Android Studio can be used to create an Android archive file (*. aar) that can contain classes and methods that make use of Android classes and related files. Like creating the Jar file, an Android project must be created first, then the Android library module can be created and added.
If you have a module defined as an android library project you'll get . aar files for all build flavors (debug and release by default) in the build/outputs/aar/ directory of that project.
The main difference is aar is splitted inside android to jar. If your app will be used only in user app only in android studio then aar is preferred. If you are planning for app to communicate with c/c++ compiled lib.so file jar is preferred.
I was having the same issue, had tried every form of including my local aar in my project, tried every method of rebuilding, invalidating caches etc, but I was still having the problem where changes in my local aar were not available after updating the file in the libs folder.
The only thing that worked for me was this:
Now the changes in yourlib.aar should be available in your project. If you have this lib included in multiple modules I am guessing you'll have to do it for each module. Not ideal, but I spent at least 5 hours on this issue and these steps were the only way I could seemingly force the changes. I am guessing that removing the library from the gradle file and then syncing will force it to pick up the new one when it is added again.
I had the same issue and solved it very quickly doing the following:
This is for an AAR included as a project (which is how it is included when you use File->New->New Module...->Import .JAR/.AAR Package).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With