Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating aar file does not reflect changes

So, i have a project in Android Studio, which I use in a plugin, which is used in an Ionic project, via an aar file. I generate the aar file by clicking in the right side of Android Studio, (where it says Graddle), expanding my project/task/build, and clicking in assemble release. The Graddle starts to work, and I have, in myProject/build/outputs/aar, an aar file. It was ok, for a time. I detected some errors in that code, corrected them, and generated the aar again.

Then, I take that aar file, copied it, and pasted in the folder specified in plugin.xml file:

<resource-file src="aar/library.aar" target="aar/library.aar" />

Then, I compile the project (the plugin, I should say) using packagr:

"packagr": "ng-packagr -p package.json && cd dist && npm pack && move *.tgz ../../"

This way, a tgz file is generated. after that, I go to the project root (the one that uses the plugin) and do

npm install @namespace/my-plugin-name

Everything looks ok. I run the project in a device...and the changes in the aar are not reflected.

Am I doing something wrong? Why are the changes not reflected?

like image 695
Fustigador Avatar asked Feb 21 '18 08:02

Fustigador


People also ask

Where is dependencies in Android Studio?

Go to File > Project Structure in Android Studio. Select the app module in the Modules list on the left. Select the Dependencies tab. Click the + button on the lower left to add the dependency.

How to add library dependency in Android Studio?

Add your AAR or JAR as a dependency To use your Android library's code in another app module, proceed as follows: Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Jar Dependency in the dropdown. In the Add Jar/Aar Dependency dialog, first enter the path to your .


1 Answers

Just had the same exact problem and found a workaround.

I changed the aar name on the aar file and gradle file of the proyect importing the library and it finally is showing my changes

Im not sure why cleaning the proyect or even deleting the build folder was not making it work.

like image 57
Nanoc Avatar answered Sep 29 '22 14:09

Nanoc