-1

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>
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Raja Sankar
  • 39
  • 10
  • Can you show us your AndroidManifest.xml file in the question? – Darshan Pania Mar 20 '18 at 07:02
  • 1
    `tools:replace="android:icon` try adding this in your `application` tag in `manifest` – Abdul Kawee Mar 20 '18 at 07:03
  • @DarshanPania i shared in question. – Raja Sankar Mar 20 '18 at 07:06
  • This is happening because the library is using the same icon name as your application. You need to google before posting here as SO has answers to this question. for eg. [here](https://stackoverflow.com/questions/30393726/imported-projects-give-error-in-android-studio-1-2-1-1).. – Somesh Kumar Mar 20 '18 at 07:08
  • As Somesh said the library is using the same icon name as your app, the `tools:replace` in your AndroidManifest will let the build script know to use your app's icon instead of the library's icon – Darshan Pania Mar 20 '18 at 07:09
  • @AbdulKawee i am getting this error,if i use "tools:replace="android:icon". Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. – Raja Sankar Mar 20 '18 at 07:10
  • share your `android:theme="@style/AppTheme"` style here – Abdul Kawee Mar 20 '18 at 07:29
  • @AbdulKawee Check the style used by me in question – Raja Sankar Mar 20 '18 at 07:41
  • @DarshanPania I changed app icon name,stil i am getting same error – Raja Sankar Mar 20 '18 at 07:41
  • Does your `SplashScreen` or any `activity` is using `ActionBarActivity` as parent activity? – Abdul Kawee Mar 20 '18 at 07:47
  • @AbdulKawee no .I am using this one. – Raja Sankar Mar 20 '18 at 07:51
  • @RajaSankar i am not talking about style . i am talking about activities – Abdul Kawee Mar 20 '18 at 07:53
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/167145/discussion-between-raja-sankar-and-abdul-kawee). – Raja Sankar Mar 20 '18 at 07:54
  • @Somesh Kumar Gurjar getting same error,even i changed image name.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. – Raja Sankar Mar 20 '18 at 07:57
  • Don't change the name, just add `tools:replace="android:icon"` to your AndroidManifest.xml file – Darshan Pania Mar 20 '18 at 12:45

1 Answers1

0

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

Raja Sankar
  • 39
  • 10