<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Manifest 屬性 通過 DSL 可以配置以下 manifest 屬性: - minSdkVersion - targetSdkVersion - versionCode - versionName - applicationId(有效的包名--查看 [ApplicationId 與 PackageName](#) 了解更多信息) - testApplicationId(測試應用的包名) - testInstrumentationRunner(Instrumentation 的 test runner) 例子: ~~~ android { compileSdkVersion 19 buildToolsVersion "19.0.0" defaultConfig { versionCode 12 versionName "2.0" minSdkVersion 16 targetSdkVersion 16 } } ~~~ 在 **android** 元素中的 **defaultConfig** 定義了所有的配置。 Android Plugin 的早期版本使用`packageName`來配置 manifest 的 `packageName` 屬性。從 0.11.0 版本開始,你應該在 `build.gradle` 中使用 `applicationId` 來配置 manifest 的 `packageName` 屬性。這是為了消除應用程序的 packageName(程序的 ID )和 java 包名所引起的歧義。 在構建文件中定義的強大之處在于它是動態的。 例如,可以從一個文件中或者其它自定義的邏輯代碼中讀取版本信息: ~~~ def computeVersionName() { ... } android { compileSdkVersion 19 buildToolsVersion "19.0.0" defaultConfig { versionCode 12 versionName computeVersionName() minSdkVersion 16 targetSdkVersion 16 } } ~~~ > 注意: 不要使用在給定范圍內同名的 getter 方法,否則可能引起沖突。例如,在 `defaultConfig{...}` 中調用 `getVersionName()` 將會自動調用 defaultConfig.getVersionName() 方法,你自定義的 getVersionName() 方法就不會被調用。 如果沒有使用 DSL 來設置屬性的值,則會使用默認的屬性值。下表是可能用到的值: | 屬性名 | 在 DSL 對象中的默認值 | 默認值 | |-----|-----|-----| | **versionCode** | -1 | 從 manifest 中讀取 | | **versionName** | null | 從 manifest 中讀取 | | **minSdkVersion** | -1 | 從 manifest 中讀取 | | **targetSdkVersion** | -1 | 從 manifest 中讀取 | | **applicationId** | null | 從 manifest 中讀取 | | **testApplicationId** | null | applicationId + “.test” | | **testInstrumentationRunner** | null | android.test.InstrumentationTestRunner | | **signingConfig** | null | null | | **proguardFile** | N/A (set only) | N/A (set only) | | **proguardFiles** | N/A (set only) | N/A (set only) | 如果你在構建腳本中使用代碼獲取這些屬性,那么第二列的值將非常重要。例如,你可能會寫: ~~~ if (android.defaultConfig.testInstrumentationRunner == null) { // assign a better default... } ~~~ 如果值一直為 `null`,那么在構建的時候將被替換成第 3 列的默認值,但是在 DSL 中沒有包含該值,所以你無法查詢到該值。除非真的有必要去設置屬性的值,否則錯誤的值可能會阻礙 Gradle 解析應用的 manifest 文件。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看