Create aar file in Android Studio
If your library is set up as an Android library (i.e. it uses the apply plugin: 'com.android.library'
statement in its build.gradle file), it will output an .aar when it's built. It will show up in the build/outputs/aar/ directory in your module's directory.
You can choose the "Android Library" type in File > New Module to create a new Android Library.
If you are still not seeing your aar
file, select Build > Rebuild Project
.
How to create new Android AAR in Android Studio
After days of unsuccessful head-banging with the IDE, I found an astoundingly simple solution in some Google results, namely:
- Manually edit project/app/build.gradle
- Change apply plugin: 'com.android.application' to apply plugin: 'com.android.library'
- Remove the line specifying applicationId.
- Build->Clean Project and Build->Rebuild Project.
Voila! New library app-debug.aar appears in project/app/build/outputs/aar/
I don't know where the name app-debug came from, but you can rename it afterwards if you like.
UPDATE 7/2/18
I omitted precursor steps to this procedure. They are
1. Create a base project however you normally do.
2. Delete classes and other stuff you don't need in the aar.
3. Follow the steps above.
How to build AAR from Android Library?
Referencing Create aar file in Android Studio, try to simply Build > Rebuild project
. AAR file should appear in ~/Source/BluePlayer/bfsdk/build/outputs/aar
How to create *.aar file from existing android studio project ( Not creating new android library)?
I did what morrison said I got that error which i sent as photo
the solution for that error was just to "Rebuilt project" after "File/Sync project ..."
( which is funny :) )
now I have aar file in my app/build/...
Export Android Library as AAR file
You should do it using gradle. Just follow these steps and you will get .aar
file:
1) At right side of your android studio there is a pane name Gradle
. Open it and then do open library
portion and run assemble
. Like in the picture below.
2) When it is successfully ran just go to your library folder
and you will find your .aar
files there.
C:\projectPath\libraryPath\build\outputs\aar
Android Studio Create AAR using another AAR file and jar inside
Use android-fat-aar gradle plugin, it is super usefull!
Related Topics
Googleservice Failed to Initialize
How to Set Opacity (Alpha) for View in Android
Android:How to Set Onclick Event for Button in List Item of Listview
Scroll Recyclerview to Show Selected Item on Top
Calling Activity Class Method from Service Class
How to Implement Drawerarrowtoggle from Android Appcompat V7 21 Library
How to Switch Activity Without Animation in Android
Changing Viewpager to Enable Infinite Page Scrolling
Record/Save Audio from Voice Recognition Intent
Finish an Activity from Another Activity
Background Service with Location Listener in Android
How to Play Videos in Android from Assets Folder or Raw Folder
Android New Bottom Navigation Bar or Bottomnavigationview
Simple Parse JSON from Url on Android and Display in Listview
How to Make a Dotted/Dashed Line in Android