OneDrive / onedrive-sdk-android

OneDrive SDK for Android!
https://dev.onedrive.com
Other
148 stars 52 forks source link

Problem with OneDrive SDK for Android SDK 31+ #167

Closed isabsent closed 1 month ago

isabsent commented 2 years ago

I am using your com.onedrive.sdk:onedrive-sdk-android:1.3.1 to access OneDrive cloud from my Android application. All is OK if targetSdkVersion 30 or less. For targetSdkVersion 31 and more I have this error:

Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

List of apks:
[0] '/home/lev/StudioProjects/explorer/app/build/outputs/apk/debug/app-debug.apk'
Installation failed due to: 'INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: 
/data/app/vmdl1023808381.tmp/base.apk (at Binary XML file line #749): com.microsoft.aad.adal.ApplicationReceiver: Targeting S+ 
(version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present'

As I understand the reason is

compile ('com.microsoft.aad:adal:1.1.7') {
    exclude module: 'com.microsoft.aad'
}

in your OneDrive SDK which has class com.microsoft.aad.adal.ApplicationReceiver with a receiver declared in the manifest of this package:

    <receiver
        android:name = "com.microsoft.aad.adal.ApplicationReceiver">
        <intent-filter>
            <action android:name="android.intent.action.PACKAGE_ADDED"/>
            <action android:name="android.intent.action.PACKAGE_INSTALL"/>
            <data android:scheme="package"/>
        </intent-filter>
    </receiver> 

where android:exported="true" should be added to avoid this bug. Can you make this change to your library?

baywet commented 1 month ago

Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #172 for more information