Search code examples
androidandroid-manifestpaytmmanifest-merging

Manifest merger error in Paytm library by adding in dependencies


While integrating Paytm,i used dependency library instead of jar file as per latest release by paytm team.i am getting below error.

Error:Execution failed for task ':app:processReleaseManifest'.

Manifest merger failed : Attribute application@icon value=(@drawable/app_icon) from AndroidManifest.xml:55:9-42 is also present at [com.paytm.pgsdk:pgsdk:1.0.6] AndroidManifest.xml:12:9-45 value=(@drawable/ic_launcher). Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:52:5-149:19 to override.

I am using this theme,Theme.AppCompat.Light.NoActionBar.

My android Manifest file.

 <application
        android:name="com.theoteq.volley.Singleton_volley"
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:screenOrientation="portrait"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <uses-library android:name="android.test.runner" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/app_id" />
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyAp5wr5YkhjgjggjjggjkgkgkELY" />
        <activity android:name="com.theoteq.xpresscarspa.Splash_Screen"
            android:theme="@style/AppTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.theoteq.xpresscarspa.Login_Screen" />
        <activity android:name="com.theoteq.xpresscarspa.Otp_Screen" />
        <activity android:name="com.theoteq.xpresscarspa.Car_Type" />
        <activity android:name="com.theoteq.xpresscarspa.MainActivity" />
        <activity android:name="com.theoteq.xpresscarspa.Address_Type" />
        <activity android:name="com.theoteq.xpresscarspa.AddInsuranceActivity" />
        <activity android:name="com.theoteq.xpresscarspa.PickUp_Map" />
        <activity android:name="com.theoteq.xpresscarspa.Date_Time" />
        <activity android:name="com.theoteq.xpresscarspa.Job_Review" />
        <activity android:name="com.theoteq.xpresscarspa.Confirmation" />
        <activity android:name="com.theoteq.xpresscarspa.ProfileView" />
        <activity android:name="com.theoteq.xpresscarspa.Locate_Us" />
        <activity android:name="com.theoteq.xpresscarspa.CarSelection" />
        <activity android:name="com.theoteq.xpresscarspa.Search_Detailing" />
        <activity android:name="com.theoteq.xpresscarspa.Search_Wash" />
        <activity android:name="com.theoteq.map.Search" />
        <activity android:name="com.theoteq.xpresscarspa.Search_MonthPackage" />
        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" />
        <receiver android:name="com.theoteq.service.SmsReciever">
            <intent-filter android:priority="999999">
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="com.google.android.gcm.GCMBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.theoteq.xpresscarspa" />
            </intent-filter>
        </receiver>

        <service android:name="com.theoteq.xpresscarspa.GCMIntentService" />

        <receiver android:name="com.theoteq.xpresscarspa.ConnectionReceiver">
            <intent-filter>
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
            </intent-filter>
        </receiver>
        <activity
            android:name="com.theoteq.xpresscarspa.Search_Two"
            android:label="@string/title_activity_search__two" />
        <activity android:name="com.theoteq.xpresscarspa.About_Us_Webview" />
        <activity android:name="com.theoteq.xpresscarspa.WebActivity" />
        <activity
            android:name="com.paytm.pgsdk.PaytmPGActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="stateHidden" />
        <activity
            android:name="com.theoteq.xpresscarspa.Payment_Activity"
            android:label="@string/title_activity_payment_"
          />
        <!--<meta-data-->
            <!--android:name="io.fabric.ApiKey"-->
            <!--android:value="6100d285268932be90ce189b361a7560b69artyu" />-->

        <activity android:name="com.theoteq.xpresscarspa.About_Us_View"></activity>

        -keepclassmembers class com.paytm.pgsdk.PaytmWebView$PaytmJavaScriptInterface {
        public *;
        }
    </application>

Style.xml

<style name="MyAppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">false</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="colorPrimary">@color/app_primary_color</item>
    <item name="colorPrimaryDark">@color/app_primary_color_dark</item>
    <item name="colorAccent" >@color/app_accent_color</item>
    <item name="android:buttonStyle">@style/Button</item> 
    <item name="android:autoCompleteTextViewStyle">@style/cursorColor</item>
</style>

Solution

  • I fixed this issue by updating Paytm library file in build gradle.