Error updating SDK 30 to SDK 31 android studio

Issue

After putting all android:exported in the places indicated by the Merged Manifest I still get an error that I’ve looked for and haven’t found please help me, as shown in the image it indicates a line where the error is but there is nothing to declare the exported there, I went back to sdk 30 and I already checked the places it asked to put the exported as true or false

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.v3.passageiro">

    <uses-feature
        android:name="android.hardware.microphone"
        android:required="false" />

    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.INTERNET" /> <!-- <permission android:name="android.permission.INTERNET" /> -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.FLAG_GRANT_READ_URI_PERMISSION" />
    <uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- Required for new Book for some else feature -->
    <uses-permission android:name="android.permission.READ_CONTACTS" />

    <!--
              <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>

                  <permission-->
<!--        android:name="vaijaa.rider.googlemapsv2.permission.MAPS_RECEIVE"-->
<!--        android:protectionLevel="signature" />-->

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.GET_TASKS" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.autofocus"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.location.gps"
        android:required="true" />

    <uses-permission
        android:name="com.v3.passageiro.googlemapsv2.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <application
        android:requestLegacyExternalStorage="true"
        android:name="com.general.files.MyApp"
        android:allowBackup="true"
        android:hardwareAccelerated="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:networkSecurityConfig="@xml/network_security_config"
        android:supportsRtl="true"
        android:theme="@style/AppCompatTheme"
        android:resizeableActivity="false"
        tools:replace="android:allowBackup">

        <uses-library
                        android:name="org.apache.http.legacy"
                        android:required="false"/>
        <activity android:name="com.v3.passageiro.MenuSettingActivity"></activity>
        <activity android:name="com.v3.passageiro.ProfilePaymentActivity" />
        <activity
            android:name="com.v3.passageiro.UberXHomeActivity"
            android:screenOrientation="portrait" />
        <activity android:name="com.v3.passageiro.MyProfileNewActivity" />
        <activity
            android:name="com.v3.passageiro.DonationActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.PrescriptionHistoryImagesActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.PrescriptionActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.ProviderInfoActivity"
            android:screenOrientation="portrait" />

        <service
            android:name="com.general.files.SinchService"
            android:exported="false" />

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_provider_paths" />
        </provider>

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_android_geo_api_key" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />


        <receiver
            android:name="com.general.files.AlarmReceiver"
            android:enabled="false">

            <!-- <intent-filter> -->
            <!-- <action android:name="android.intent.action.BOOT_COMPLETED" /> -->
            <!-- </intent-filter> -->
        </receiver>

        <service android:name="com.v3.passageiro.MyFirebaseMessagingService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
        <!--
 <service
            android:name="com.general.files.MyBackGroundService"
            android:enabled="true"
            android:icon="@mipmap/ic_launcher"
            android:label="Service Alert"
            android:persistent="true" />
        -->
        <!--
   <receiver
            android:name=".StartServiceReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />

                <category android:name="android.intent.category.DEFAULT" />

                <action android:name="android.intent.action.REBOOT" />
                <action android:name="vaijaa.rider.StartServiceReceiver" />
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.REBOOT" />
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.REBOOT" />
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.REBOOT" />
            </intent-filter>
        </receiver>
        -->
        <activity
            android:name="com.twitter.sdk.android.core.identity.OAuthActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.LauncherActivity"
            android:exported="true"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.v3.passageiro.AppLoginActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.SelectCountryActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.MainActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.VerifyFbProfileActivity"
            android:screenOrientation="portrait" />

        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:theme="@style/FBtheme"
            tools:replace="android:theme" />
        <activity
            android:name="com.v3.passageiro.SearchPickupLocationActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.FareEstimateActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.MyProfileActivity"
            android:exported="true"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.StaticPageActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.ContactUsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.HelpActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.QuestionAnswerActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.HistoryDetailActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.App.Base" />
        <activity
            android:name="com.v3.passageiro.RatingActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.CardPaymentActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.EmergencyContactActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.ConfirmEmergencyTapActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.EnterDeliveryDetailsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.MyWalletActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.MyWalletHistoryActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.InviteFriendsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.VerifyInfoActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.UberXSelectServiceActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.UberXActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.OnGoingTripsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.OnGoingTripDetailsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.AppLoignRegisterActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.AccountverificationActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.SupportActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.FareBreakDownActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.ForgotPasswordActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.PrefranceActivity"
            android:screenOrientation="portrait" />

        <receiver
            android:name="com.v3.passageiro.FirebaseDataReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </receiver>

        <activity
            android:name="com.v3.passageiro.ChatActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.SearchLocationActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.ListAddressActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.AddAddressActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.ScheduleDateSelectActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.UfxOrderDetailsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.UfxPaymentActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.BookingSummaryActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.MaintenanceActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.Help_MainCategory"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.Help_SubCategoryActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.Help_DetailsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.RentalInfoActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.RentalDetailsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
            android:launchMode="singleTask"
            android:exported="true"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="${applicationId}.braintree" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.v3.passageiro.VerifyCardTokenActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="co.omise.android.ui.CreditCardActivity"
            android:screenOrientation="portrait"
            android:theme="@style/OmiseSDKTheme" />
        <activity
            android:name="com.xendit.XenditActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.cropper.CropImageActivity"
            android:screenOrientation="portrait" /> <!-- Multi delivery_v2 Screens -->
        <activity
            android:name="com.v3.passageiro.CommonDeliveryTypeSelectionActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.EnterMultiDeliveryDetailsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.MultiDeliverySecondPhaseActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.MultiDeliveryThirdPhaseActivity"
            android:screenOrientation="portrait" /> <!-- Deliver all -->
        <activity
            android:name="com.v3.passageiro.deliverAll.FoodDeliveryHomeActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.RestaurantAllDetailsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.SearchFoodActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.RestaurantsSearchActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.SearchRestaurantListActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.AddBasketActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.CheckOutActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.EditCartActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.PaymentCardActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.ServiceHomeActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.ViewCardActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.OrderPlaceConfirmActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.ActiveOrderActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.TrackOrderActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.OrderDetailsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.FoodRatingActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.RestaurantAllDetailsNewActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.LoginActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.deliverAll.SignUpActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="io.card.payment.CardIOActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.CouponActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.BusinessProfileActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.BusinessSetupActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.SelectOrganizationActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.OrganizationActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.MyBusinessProfileActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.BusinessSelectPaymentActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.IncomingCallScreenActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.CallScreenActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.NotificationActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.NotificationDetailsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.QuickPaymentActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.livechatinc.inappchat.ChatWindowActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.UberxFilterActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.MoreInfoActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.UberxCartActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.CarWashBookingDetailsActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.MoreServiceInfoActivity"
            android:screenOrientation="portrait" /> <!-- Book for Some Else Activities -->
        <activity
            android:name="com.v3.passageiro.BookSomeOneElsePickContactActivity"
            android:screenOrientation="portrait" /> <!-- FavDriver Activities -->
        <activity
            android:name="com.v3.passageiro.FavouriteDriverActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.BookingActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.v3.passageiro.ViewMultiDeliveryDetailsActivity"
            android:screenOrientation="portrait" />
    </application>

</manifest>

image

Solution

update:

The problem is caused by the Android Manifest file in other SDK(AAR file).

option 1: upgrade the official AAR to the version with correct manifest.

option 2: modify the manifest file in AAR. how to modify AAR


previous answer:

Do you use Sinch SDK in your project? Maybe you could try to upgrade the version of Sinch SDK.

According to the release notes, the android:exported attribute has been added in version
4.8.6.
enter image description here

Answered By – Kai

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published