久久久久久久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 庫的傳遞依賴)
主站蜘蛛池模板: 亚洲黄色成人网 | 午夜在线 | 国产精品不卡 | 国产精品无码久久久久 | 亚洲国产18| 日韩免费在线视频 | 亚洲国产日韩欧美 | 99热精品久久 | 亚洲精品亚洲人成人网 | 欧美精品三区 | 一区二区三区在线播放 | 中文字幕国产精品视频 | 久久久久成人精品亚洲国产 | 久久久久国产精品一区二区 | 天天久久 | 欧美高清免费 | 欧美一区二区三区久久精品 | 黄色免费在线观看 | 天天草视频 | 精产嫩模国品一二三区 | 精品一区国产 | 一级毛片成人免费看a | 精品国产免费一区二区三区五区 | 免费永久av | 一级一片在线观看 | 伊人网伊人网 | 美女视频一区二区三区 | 日韩在线免费 | 精品一区二区观看 | 日本一区二区三区免费观看 | 99久久精品免费 | 久久精品国产一区二区三区不卡 | 亚洲精品毛片av | 久久综合久色欧美综合狠狠 | 欧美www在线| 在线国产一区二区 | 成人精品鲁一区一区二区 | 羞羞视频网站在线观看 | 日本久久综合 | 性色视频 | 福利二区 |