Search code examples
androidestimoteaar

Including an AAR file conditionally


I am using the Estimote SDK, which is included into my project as an AAR file. I want to use the SDK on devices which support Bluetooth LE, but also want to allow users who do not have supported hardware to install.

The manifest of the Estimote SDK includes:

<uses-feature
    android:name="android.hardware.bluetooth_le"
    android:required="true" />

and this prevents the App from installing on a lot of devices.

I can overrule the android:minSdkVersion:

<uses-sdk android:minSdkVersion="18" />

with

<uses-sdk tools:overrideLibrary="com.estimote.sdk" />

but I don't know how to overrule e.g. the bluetooth_le directive. I tried unzipping the 'aar', changing the Manifest and repacking as a zip with .aar extension, but I get:

Error:Execution failed for task ':idoms-android:processIDomsAndroidDevDebugManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: /Users/Luuk/Documents/Java/idoms-android/idoms-android/build/intermediates/exploded-aar/estimote-sdk-preview/AndroidManifest.xml (No such file or directory)

even thought the file is there. Any help would be appreciated!


Solution

  • @Luuk

    I'm a author of Estimote Android SDK.

    We will be changing <uses-feature android:name="android.hardware.bluetooth_le"> to required=false for the next SDK release .