square/reader-sdk-android-quickstart

Android 12 - ReaderSDK - parameter exported in AndroidManifest.xml

jantursky opened this issue · 0 comments

We are using Square ReaderSDK library for implementing communication of Reader with our Point of Sale Android application. We set these two fields for the building of the app to the latest version, because of the need of other libraries, which are requiring it for the correct working:

compileSdkVersion 31
buildToolsVersion 31

Then we also implemented latest Square libs for the above functionality:
implementation "com.squareup.sdk.reader:reader-sdk-$SQUARE_READER_SDK_APPLICATION_ID:1.5.1"
runtimeOnly "com.squareup.sdk.reader:reader-sdk-internals:1.5.1"

Unfortunately, once we tried to build the app even for debug purposes, we received the error message:
Manifest merger failed : android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See <activity> | Android Developers 1 for details.

We found, that it’s caused by missing the field android:exported for any component in AndroidManifest.xml file which includes parameter with the body. So we went through the merged manifest (once we decreased/reverted the build version and tried to find which components are missing this field and are blocking us from success building). And it looks like, that this files defined within dependent libraries are missing it:

com.squareup.ui.ApiActivity
com.squareup.ui.LocationActivity
com.squareup.ui.main.ApiMainActivity
com.squareup.queue.QueueService$BootReceiver
com.squareup.notification.LocaleChangeReceiver
com.squareup.cardreader.ble.lock.PosMarkerReceiver

Is there a possibility to add that exported field into this SquareReaderSDK library with also all their dependencies so that it will support also the latest Android version 12 (build version code 31)?