gpt4 book ai didi

android - 即使使用工具 :replace ="android:icon,android:theme" 也出现 list 合并抛出错误

转载 作者:太空狗 更新时间:2023-10-29 14:05:02 24 4
gpt4 key购买 nike

我在使用 tools:replace="android:icon,android:theme"

进行 list 合并时遇到问题

注意:我在这里只发布应用程序标签

我的主要应用 list 如下:

<?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="in.gobo"
android:installLocation="auto">

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="22" />

<permission
android:name=".permission.C2D_MESSAGE"
android:protectionLevel="signature" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />

<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- This app has permission to register and receive data message. -->
<uses-permission android:name=".permission.C2D_MESSAGE" />

<!--tools:replace="icon, label"-->
<application
android:name=".code.GoboApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"

>

如果如下所示,我的模块 list :

<?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.payUMoney.sdk" >

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

<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />

<!-- Create and manage accounts on device -->
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />

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

<!-- <permission
android:name="com.payUMoney.sdk.permission.C2D_MESSAGE"
android:protectionLevel="signature" />

<uses-permission android:name="com.payUMoney.sdk.permission.C2D_MESSAGE" />-->

<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Extract device IEMI number -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- Access Wifi State -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<uses-feature
android:name="android.hardware.telephony"
android:required="false"
/>
<!--tools:replace="android:icon"

-->
<application
android:allowBackup="true"
android:windowSoftInputMode="adjustPan"
android:icon="@drawable/green_app_launcher"
android:label="@string/app_name"
android:theme="@style/MyTheme"
tools:replace="android:icon,android:theme"
>

并且编译时抛出错误:

 Error:(43, 9) Attribute application@icon value=
(@drawable/ic_launcher) from AndroidManifest.xml:43:9 Error:(45, 9)
Attribute application@theme value=(@style/AppTheme) from
AndroidManifest.xml:45:9 is also present at gobo-user:PayUMoneySDK-
Android:unspecified:67:9 value=(@style/MyTheme) Suggestion: add
'tools:replace="android:theme"' to <application> element at
AndroidManifest.xml:40:5 to override Error:Execution failed for task
':app:processDebugManifest'. Manifest merger failed with multiple
errors, see logs

最佳答案

只需从您的应用程序 list 中删除 icon="@drawable/ic_launcher"theme="@theme/MyTheme" 并将 PayU SDK 中的 drawable ic_launcher 替换为您的应用程序 Logo ,这样就可以了。

应用程序将合并两个 list ,您将获得所需的主题和 Logo 将从 PayU 的 list 中获取,因此您可以将他们的 ic_launcher 替换为您的

关于android - 即使使用工具 :replace ="android:icon,android:theme" 也出现 list 合并抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33186969/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com