久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Gradle“清單需要占位符替換"錯誤但 manifestP

Gradle quot;manifest requires a placeholder substitutionquot; error but manifestPlaceholders supplies a value(Gradle“清單需要占位符替換錯誤但 manifestPlaceholders 提供了一個值)
本文介紹了Gradle“清單需要占位符替換"錯誤但 manifestPlaceholders 提供了一個值的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試在 build.gradle android 擴展的 AndroidManifest.xml 文件中執行替換,但出現此錯誤:

I'm trying to perform substitution within the AndroidManifest.xml file from the build.gradle android extension but am getting this error:

AndroidManifest.xml:89:16 Error:
    Attribute uses-library#com.company.platform.${encoding}@name at AndroidManifest.xml:89:16 requires a placeholder substitution but no value for <encoding> is provided.
/Users/Company/Desktop/Checkout/android/Project/app/src/main/AndroidManifest.xml:0:0 Error:
    Validation failed, exiting
:app:processDebugManifest FAILED

這是清單文件的片段:

...
     </receiver>
   <uses-library android:name="com.company.platform.${encoding}" />
</application>
...

這是 build.gradle 的片段:

And this is a snipped of the build.gradle:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    defaultConfig {
        applicationId "com.company.app"
        minSdkVersion 23
        targetSdkVersion 23
        versionName cityVersion
        setProperty("archivesBaseName", "City_$versionName")
        manifestPlaceholders = [encoding: "some value"]
        manifestPlaceholders = [version: cityVersion]
    }

我也嘗試在 buildTypes 中添加 manifestPlaceholders,即

I've also tried adding the manifestPlaceholders in the buildTypes i.e.

buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        manifestPlaceholders = [encoding: deviceEncoding]
        manifestPlaceholders = [version: cityIDVersion]
   }
    debug {
        manifestPlaceholders = [encoding: deviceEncoding]
        manifestPlaceholders = [version: cityIDVersion]
    }

}

但我仍然遇到同樣的錯誤.

But I still get the same error.

當 manifestPlaceholders 中提供了占位符替換時,為什么會出現需要替換占位符的錯誤?

Why is there an error about it requiring a placeholder substitution when one is provided for in the manifestPlaceholders?

推薦答案

你只需要添加到數組中.你正在替換它.這樣做:

You need to just add to the array. You are replacing it. Do this:

manifestPlaceholders = [encoding: "some value", version: cityVersion]

通過為相同的風格/構建類型聲明 manifestPlaceholders 兩次,您將替換前一個.替換前一個后,您的構建失敗,因為該屬性不再存在.

By declaring manifestPlaceholders twice for the same flavor/build type, your are replacing the previous one. After the previous one got replaced, your build failed because the property no longer exists.

這篇關于Gradle“清單需要占位符替換"錯誤但 manifestPlaceholders 提供了一個值的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現 IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當前風味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風味庫的多風味應用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: 天天操 天天操 | 国产精品成人久久久久a级 久久蜜桃av一区二区天堂 | 91久久国产综合久久91精品网站 | 久久精品亚洲精品国产欧美 | 99视频在线播放 | 欧美日韩国产高清视频 | av天天干 | 午夜天堂精品久久久久 | 欧美日韩精品一区二区三区蜜桃 | 久久成人高清视频 | 欧美一区永久视频免费观看 | 亚洲免费视频在线观看 | 午夜免费福利影院 | 国产成人免费视频网站视频社区 | 亚洲麻豆 | 精品久久99| 午夜视频精品 | 欧美国产视频一区二区 | 在线激情视频 | 91网站在线观看视频 | 欧美性生活视频 | 亚洲国产偷 | 国产午夜在线 | 午夜影院在线观看版 | 日韩在线一区二区 | 欧美中文字幕一区 | 国色天香成人网 | 日韩成人在线观看 | 欧美日韩国产一区二区三区 | 国产黄色小视频在线观看 | 亚洲一区二区中文字幕在线观看 | 国产高清精品网站 | 岛国av一区二区 | 精品一区二区在线视频 | 天天操天天天 | 盗摄精品av一区二区三区 | 国产精品美女久久久久久免费 | 精品二区视频 | 日韩欧美一区二区三区免费观看 | 国产区在线 | 一区二区三区四区在线视频 |