1. 程式人生 > >manifest.xml中label應用名報錯

manifest.xml中label應用名報錯

今天寫程式碼的時候遇到這個錯誤

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute [email protected] value=(@string/app_name) from AndroidManifest.xml:18:9-42
    is also present at [org.litepal.android:core:1.6.0] AndroidManifest.xml:13:9-41 value=(@string/app_name).
    Suggestion: add
'tools:replace="android:label"' to <application> element at AndroidManifest.xml:14:5-67:19 to override.

這個錯誤是因為你匯入的一些第三方的庫定義了與主專案相同的屬性。
上面的提示就是litepal這個庫和主專案AndroidManifest檔案中的label屬性有衝突。而且提示用也給出瞭解決的方法就是在AndroidManifestapplication節點下加上tools:replace="android:label"

    <application
        android:name=".base.MyApplication"
android:allowBackup="true" android:icon="@mipmap/logo_128" android:label="@string/app_name" android:screenOrientation="portrait" android:supportsRtl="true" android:theme="@style/Theme.AppCompat.Light.NoActionBar" tools:replace="android:icon, android:label, android:theme"
> ... </application>

如果加上之後,可以編譯了,但是APP的名字還是使用了第三方庫中的app_name,我們可以這樣解決,在自己的strings.xml中將app_name換一下,比如換成app_name_

<string name="app_name_">移動APP</string>

然後清單檔案就如下了

    <application
        android:name=".base.MyApplication"
        android:allowBackup="true"
        android:icon="@mipmap/logo_128"
        android:label="@string/app_name_"
        android:screenOrientation="portrait"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar"
        tools:replace="android:icon, android:label, android:theme">
        ...
    </application>

這樣再執行就能用回自己的命名了。

相關推薦

manifest.xmllabel應用

今天寫程式碼的時候遇到這個錯誤 Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger

mybatis xml是sql語句: Error creating document instance. Cause: org.xml.sax.SAXPa

今天遇到了這個問題,感覺很奇怪,沒有什麼問題,但是還是會報錯。 在網上找了半天,用第二種方法解決了這個問題。第一種方法沒有嘗試。以此來記錄下。 感覺這個問題出現概率很大。要記著呢。 1、使用轉移字元替代 &lt; < &gt; &

pom.xmlwar

第一次搭框架, 剛寫pom.xml的時候<packaging>war</packaging>就報錯, 最後發現是build裡的一個資源找不到 (複製別人的樣例, 這個檔案我還沒有建立) 我這個是資料庫連線的配置文件,補上以後就不報錯了 供

pom.xml無法下載包

小編近日在pom.xml中配置需要下載的jar包時,maven重新整理怎麼都下載不了,報錯: Dependency 'org.springframework:spring-web:4.3.10.RELEASE' not found less... (Ctrl+F1)  Inspec

IDEA 匯入或新建maven專案 web.xml配置檔案路徑,配置檔案找不到

某次碰到一個很奇怪的問題,本來專案沒問題的,重新匯入到Idea執行時就跑不起來了。 跑專案時,報如下錯誤: 看報錯好像是log4j2的配置檔案找不到 不可能呀,上次還跑得好好的,檔案也都在。 於是我進入web.xml看看: 怎麼配置檔案都報紅了

mybatis xml是sql語句: Error creating document instance. Cause: org.xml.sax.SAXParseException: The

最近專案折騰了老半天,找了資料才知道是這麼回事。。。 因為語句中有一個小於號“<”,在XML中,會被當成一個頁面元素來解析,不會處理為mysql的SQL語句的組成部分,修改如下: 1、在xml的sql語句中,不能直接用大於號、小於號要用轉義字元 如果用小於

Android Studio寫了一個工具類,進行測試時在Manifest.xml

這是包,utils下的HttpUtils是工具類 在Manifest.xml檔案下寫<instrumentation時報錯,<instrumentation></instrumentation>部分程式碼如下:<instrumentati

程式碼動態設定id-ids.xml的使用

專案中經常在xml中設定id,然後在程式碼中進行findViewById繫結; 但是如果這個view是程式碼中動態生成的,在設定id保證view的唯一標識時發現setId(int)方法傳入整數是不行的,會提示如下錯誤 解決方法: 在res/values/下建立ids.xml <

【Netapp】在模擬器使用disk removeowner

disk removeowner報錯信息如下:Cluster2::storage disk*> removeowner NET-1.43 Error: command failed: Disk NET-1.43 is not conne

自己封裝framworks上傳到應用商店

script uil iss strong find lac targe 內容 link 參考鏈接: http://www.jianshu.com/p/60ac3ded34a0 http://ikennd.ac/blog/2015/02/stripping-unwanted

XerCMS-1.0.3代碼審計(文件註入後臺getshell)

each orb his jpg pla module 將不 last self 鏈接:https://share.weiyun.com/6b98e41d036967178e1a21fb88ed340f (密碼:YnNY) 文件名報錯註入 index.php?m=memb

項目,但是項目裏不顯示錯誤的問題

targe all myeclips face 錯誤 itl ase jre 編譯 project 編譯問題,需要三處的jdk版本要保持一致,才能編譯通過。 1、在項目上右鍵properties->MyEclipse->project Facets->ja

讀取文件後綴:Notice: Only variables should be passed by reference in

-s size pre sse 手冊 strtol sed col only 在寫讀取後綴名函數時遇到此通知錯誤: function getExt($fileName){ // $tmp = explode(".", $fileName); retur

vscode使用Experimental Decorators

rim tps https png true img 需要 ges 根目錄 在vscode中使用es7的新語法decorator會報錯,如圖: 這是錯誤來自與vscode的JS support,只要在項目根目錄下創建一個jsconfig.json文件,添加如下內

已經設置utf8的mysql cmd插入中文執行解決方法

客戶 res img 說明 設置 -1 bsp 插入 gbk 說明cmd客戶端的字符集是gbk,結果集也要設置為gbk。 使用語句 set character_set_client=gbk; set character_set_results=gbk; 就

vuex2使用mapMutations/mapActions解決方法 BabelLoaderError: SyntaxError: Unexpected token

int cte 使用 gin ets lin ade vue 編譯 在嘗鮮vuex2時,發現vuex2增加了 mapGetters 和 mapActions 的方法,借助stage2的 Object Rest Operator 特性,可以寫出下面代碼:methods: {

IDEA Spark 讀Hbase 處理:

ado htable client ets rim ogg expec zookeep ati SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 17/11/19 14:25:57 E

Restful風格,PUT修改功能請求,表單存在文件-HTTP Status 405 - Request method 'POST' not supported

for 文件的 文件 roo spring commons 容量 put common 解決方案配置如下 <!-- 配置文件上傳解析器 --> <bean id="multipartResolver" class="org.spri

win10刪除了應用商店重新安裝,應用商店不能聯網下載

users inter pos tro develop nbsp 除了 安裝 AD 獲取系統版本對應的商店版本 管理員打開powershell執行: Get-AppxPackage -allusers | Select Name, PackageFullName 安裝:

【Tomcat】JPS常見的tomcat錯誤分析

tomcat1:請求收到,繼續處理2:操作成功收到,分析、接受3:完成此請求必須進一步處理4:請求包含一個錯誤語法或不能完成5**:服務器執行一個完全有效請求失敗 100——客戶必須繼續發出請求101——客戶要求服務器根據請求轉換HTTP協議版本 200——交易成功201——提示知道新文件的URL202——接