2

1) i would like to use android project as library to another project . i have created the .aar file from the library project. and extract it to get classes.jar file.

2) i use the jar file in libs folder and compile it in build.gradle file.

3)

// call to library project activity class     
<activity
    android:name="com.magento.MainActivity"></activity>

4) i woluld like to call these mainactivity.it crash the app.due to not registered acitvity in manifeast file

5) for the i find to use mainfeast merger in properties file.but not able to find that one in android studio

can anybody help on this?

here i suffered new issues kindly help on this

Attribute application@theme value=(@style/AppTheme.NoActionBar) from AndroidManifest.xml:29:9-52
    is also present at [com.elitesalonapp.aar:emc:] AndroidManifest.xml:48:9-57 value=(@android:style/Theme.Translucent).
    Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:22:5-159:19 to override.

    Attribute meta-data#com.facebook.sdk.ApplicationId@value value=(@string/facebook_app_id) from AndroidManifest.xml:33:13-52
    is also present at [com.elitesalonapp.aar:emc:] AndroidManifest.xml:60:13-43 value=(@string/app_id).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:31:9-33:55 to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:app:processDebugManifest FAILED
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
Himank shah
  • 131
  • 13

3 Answers3

0

An AAR is the proper dependency artifact for an Android Library project. It contains the manifest entries, resources, assets, and code that should be imported into the app.

When you pulled the jar out of the aar, you also removed the ability for the Android build tools to pull in any manifest entries, resources, and assets that may have been included in the aar. Instead of extracting a jar, you should depend on the aar and let the Android tools merge everything into the app. You can read about aar here.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
0

Edit File -> New Module -> Import .JAR/.AAR and import your .AAR.

add following in build.gradle

dependencies {
    compile(name:'abc', ext:'aar')
}
Android Geek
  • 8,956
  • 2
  • 21
  • 35
0

add this in build.gradle

dependencies {
    compile(name:'<your lib name>',ext:'aar')
}
repositories{
flatDir{
    //add the dir where your .arr lib in
    dirs '<folder name>'
}

look the sample here

shingle
  • 19
  • 5