通过添加依赖项在 Paytm 库中显示合并错误
Manifest merger error in Paytm library by adding in dependencies
在集成 Paytm 时,根据 paytm 的最新版本,我使用了依赖库而不是 jar 文件team.i 出现以下错误。
错误:任务“: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.
我正在使用这个主题,Theme.AppCompat.Light.NoActionBar。
我的 android 清单文件。
<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>
我通过更新构建 gradle 中的 Paytm 库文件解决了这个问题。
在集成 Paytm 时,根据 paytm 的最新版本,我使用了依赖库而不是 jar 文件team.i 出现以下错误。
错误:任务“: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.
我正在使用这个主题,Theme.AppCompat.Light.NoActionBar。
我的 android 清单文件。
<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>
我通过更新构建 gradle 中的 Paytm 库文件解决了这个问题。