<i id='EuXcb'><tr id='EuXcb'><dt id='EuXcb'><q id='EuXcb'><span id='EuXcb'><b id='EuXcb'><form id='EuXcb'><ins id='EuXcb'></ins><ul id='EuXcb'></ul><sub id='EuXcb'></sub></form><legend id='EuXcb'></legend><bdo id='EuXcb'><pre id='EuXcb'><center id='EuXcb'></center></pre></bdo></b><th id='EuXcb'></th></span></q></dt></tr></i><div id='EuXcb'><tfoot id='EuXcb'></tfoot><dl id='EuXcb'><fieldset id='EuXcb'></fieldset></dl></div>
  • <tfoot id='EuXcb'></tfoot>
  • <small id='EuXcb'></small><noframes id='EuXcb'>

    • <bdo id='EuXcb'></bdo><ul id='EuXcb'></ul>
      <legend id='EuXcb'><style id='EuXcb'><dir id='EuXcb'><q id='EuXcb'></q></dir></style></legend>

      1. Google Play 错误:无法上传仅供测试的 APK

        Google Play error: cannot upload a test-only APK(Google Play 错误:无法上传仅供测试的 APK)

          <bdo id='4B5ox'></bdo><ul id='4B5ox'></ul>
          <i id='4B5ox'><tr id='4B5ox'><dt id='4B5ox'><q id='4B5ox'><span id='4B5ox'><b id='4B5ox'><form id='4B5ox'><ins id='4B5ox'></ins><ul id='4B5ox'></ul><sub id='4B5ox'></sub></form><legend id='4B5ox'></legend><bdo id='4B5ox'><pre id='4B5ox'><center id='4B5ox'></center></pre></bdo></b><th id='4B5ox'></th></span></q></dt></tr></i><div id='4B5ox'><tfoot id='4B5ox'></tfoot><dl id='4B5ox'><fieldset id='4B5ox'></fieldset></dl></div>
            • <legend id='4B5ox'><style id='4B5ox'><dir id='4B5ox'><q id='4B5ox'></q></dir></style></legend>

              <small id='4B5ox'></small><noframes id='4B5ox'>

              1. <tfoot id='4B5ox'></tfoot>
                    <tbody id='4B5ox'></tbody>
                  本文介绍了Google Play 错误:无法上传仅供测试的 APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  尝试将第一个 apk 上传到 GooglePlay 控制台中最近创建的项目时,我收到此错误:

                  When trying to upload the first apk to a recently created project in GooglePlay console, I receive this error:

                  您不能上传仅供测试的 APK

                  You cannot upload a test-only APK

                  按照今天的情况,在 Google 中搜索该确切字符串的结果为 0.

                  Searching Google gives me 0 results for that exact string as per today.

                  我还提交了 Play 管理中心的票证.如果有任何答案,将在这里更新.

                  I also have submitted a ticket for Play Console. Will update here if have any answer.

                  2017 年 11 月 29 日更新

                  正如@paul-lammertsma 建议的那样,有一个解决方法.仍然很高兴知道为什么我们需要采用 gradle 方式,而我们不能通过 IDE 来实现.

                  As @paul-lammertsma suggested, there's a workaround. Still would be good to know why we need to go gradle way and we cannot do it via IDE.

                  推荐答案

                  通过 Android Studio 3.0 及更高版本构建应用程序会将 android:testOnly="true" 添加到应用程序清单中,标记APK 为 FLAG_TEST_ONLY对于 PackageManager.在此处了解有关 CommonsBlog 的更多信息.

                  Building your app through Android Studio 3.0 and later will add android:testOnly="true" to your application manifest, marking the APK as FLAG_TEST_ONLY for the PackageManager. More information on CommonsBlog here.

                  尝试在 Android Studio 之外安装此类 APK 会失败:

                  Attempting to install such an APK outside of Android Studio will fail with:

                  安装 app-debug.apk 失败:失败 [INSTALL_FAILED_TEST_ONLY: installPackageLI]

                  Failed to install app-debug.apk: Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]

                  尝试将其上传到 Google Play 也会失败,并显示:

                  Attempting to upload it to Google Play will also fail, with :

                  您不能上传仅供测试的 APK

                  You cannot upload a test-only APK

                  对此有四种解决方案:

                  只需选择构建 APK(s)";来自构建"Android Studio 中的菜单.

                  Simply select "Build APK(s)" from the "Build" menu in Android Studio.

                  只需选择生成签名的 APK...";来自构建"Android Studio 中的菜单.提供密钥库并在显示的对话框中输入签名详细信息.

                  Simply select "Generate Signed APK..." from the "Build" menu in Android Studio. Provide the keystore and enter the signing details in the dialog that displays.

                  您当然可以简单地从终端执行 Gradle 以实现一些自动化,例如,如果您的部署周期通过 CI 运行(我强烈推荐!):

                  You can of course simply execute Gradle from the terminal for some automation, for instance if your deployment cycle runs through CI (which I highly recommend!):

                  ./gradlew assembleRelease
                  

                  (或者,您可能更喜欢在 Android Studio 的 Gradle 窗格中运行此 Gradle 任务.)

                  (Alternatively, you may prefer running this Gradle task from the Gradle pane from within Android Studio.)

                  如果您不喜欢这种行为,您可以选择将此标志添加到您的 gradle.properties.请注意,测试标志是为了保护您自己,所以您不会意外发布仅用于测试的 APK!

                  If you don't like this behavior, you may elect to add this flag to your gradle.properties. Beware that the test flag is for your own protection, so you don't accidentally publish a test-only APK!

                  # Disble testOnly mode for Android Studio
                  android.injected.testOnly=false
                  

                  这篇关于Google Play 错误:无法上传仅供测试的 APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Android - Is it possible to get install referrer programmatically(Android - 是否有可能以编程方式安装引荐来源网址)
                  How to sign an APK with more than one certificate?(如何使用多个证书签署 APK?)
                  versionCode vs versionName in Android Manifest(Android Manifest 中的 versionCode 与 versionName)
                  What does this Google Play APK publish error message mean?(这个 Google Play APK 发布错误消息是什么意思?)
                  Lost my keystore for uploaded app on android market(丢失了我在 android 市场上上传的应用程序的密钥库)
                  App on Google Play always shows quot;Updatequot; instead of open(Google Play 上的应用程序总是显示“更新;而不是打开)

                            <bdo id='AGAl2'></bdo><ul id='AGAl2'></ul>

                            <i id='AGAl2'><tr id='AGAl2'><dt id='AGAl2'><q id='AGAl2'><span id='AGAl2'><b id='AGAl2'><form id='AGAl2'><ins id='AGAl2'></ins><ul id='AGAl2'></ul><sub id='AGAl2'></sub></form><legend id='AGAl2'></legend><bdo id='AGAl2'><pre id='AGAl2'><center id='AGAl2'></center></pre></bdo></b><th id='AGAl2'></th></span></q></dt></tr></i><div id='AGAl2'><tfoot id='AGAl2'></tfoot><dl id='AGAl2'><fieldset id='AGAl2'></fieldset></dl></div>
                            <tfoot id='AGAl2'></tfoot>
                          • <legend id='AGAl2'><style id='AGAl2'><dir id='AGAl2'><q id='AGAl2'></q></dir></style></legend>

                              <tbody id='AGAl2'></tbody>

                            <small id='AGAl2'></small><noframes id='AGAl2'>