Studio中生成APK签上不工作构建0

Studio中生成APK签上不工作构建0

本文介绍了Android Studio中生成APK签上不工作构建0.3.6 - 给错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前从来没有过这个问题。当我尝试并生成APK签,选择我的密钥存储,输入文件名,它给了我一个错误。

I have never had a problem with this before. When i try and generate signed apk, select my keystore, enter filename, it gives me an error.

不能找到的XXXX-调试unaligned.apk

Cant find the XXXX-debug-unaligned.apk

我没有任何签约CONFIGS或建立各种类型的安装在我的build.gradle因为我从来没有需要他们。我一直用生成APK签署和它产生的apk我

I don't have any signing configs or build types setup in my build.gradle because i never needed them. I have always used generate signed apk and it produces my apk.

我从升级到0.3.4 0.3.6我从调试/发行版本的变种选择要让它开始工作之前没有通知。但是,这是已经发生过的第一次。升级到0.3.6后没有构建变种。不知道他们是如何到达那里下手,因为我没有在任何的build.gradle设置。

I did notice before upgrading from 0.3.4 to 0.3.6 i had to choose from debug/release build variants to get it to work. But that was the first time that had happened too. After upgrading to 0.3.6 there are no build variants. Not sure how they got there to start with since i didnt have anything setup in the build.gradle.

我能够运行gradle这个assembleRelease让我的APK,但希望产生签署的apk如果可能的工作。

I am able to run a gradle assembleRelease to get my apk, but want the generate signed apk working if possible.

推荐答案

不知道这是一个问题与0.3.6版本,但我有固定的

Not sure if this was an issue with 0.3.6 version but i have fixed it

走进了moduel IML文件和改变assembleRelease到assembleDebug。您还可以改变IML的其余部分。这里是我的。

Going into the moduel iml file and changing assembleRelease to assembleDebug. You also have to alter the rest of the iml. here is mine.

    <?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="android" name="Android">
      <configuration>
        <option name="SELECTED_BUILD_VARIANT" value="Debug" />
        <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
        <option name="COMPILE_JAVA_TASK_NAME" value="assembleTest" />
        <option name="SOURCE_GEN_TASK_NAME" value="generateReleaseSources" />
        <option name="ALLOW_USER_CONFIGURATION" value="false" />
        <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
        <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
        <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
        <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
        <option name="APK_PATH" value="/build/apk/Clean.Multi-debug-unaligned.apk" />
      </configuration>
    </facet>
    <facet type="android-gradle" name="Android-Gradle">
      <configuration>
        <option name="GRADLE_PROJECT_PATH" value=":Clean.Multi" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" inherit-compiler-output="false">
    <output url="file://$MODULE_DIR$/build/classes/debug" />
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/build/source/r/debug" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/build/source/aidl/debug" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/build/source/rs/debug" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/debug" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/build/res/rs/debug" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/build/source/r/test" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/source/aidl/test" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/source/rs/test" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/test" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/res/rs/test" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/res" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/assets" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/res" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/assets" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/jni" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/rs" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/res" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/resources" isTestSource="true" />
      <excludeFolder url="file://$MODULE_DIR$/build/apk" />
      <excludeFolder url="file://$MODULE_DIR$/build/assets" />
      <excludeFolder url="file://$MODULE_DIR$/build/bundles" />
      <excludeFolder url="file://$MODULE_DIR$/build/classes" />
      <excludeFolder url="file://$MODULE_DIR$/build/dependency-cache" />
      <excludeFolder url="file://$MODULE_DIR$/build/incremental" />
      <excludeFolder url="file://$MODULE_DIR$/build/libs" />
      <excludeFolder url="file://$MODULE_DIR$/build/manifests" />
      <excludeFolder url="file://$MODULE_DIR$/build/symbols" />
      <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
    </content>
    <orderEntry type="jdk" jdkName="Android SDK" jdkType="Android SDK" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" exported="" name="ComGithubGabrielemariottiCardsLibrary050.aar" level="project" />
    <orderEntry type="library" exported="" name="picasso-2.1.1" level="project" />
    <orderEntry type="library" exported="" name="ComAndroidSupportAppcompatV71800.aar" level="project" />
    <orderEntry type="library" exported="" name="android-async-http-1.4.2" level="project" />
    <orderEntry type="library" exported="" name="kryo-2.21-all" level="project" />
    <orderEntry type="library" exported="" name="httpclientandroidlib-1.1.2" level="project" />
    <orderEntry type="library" exported="" name="support-v4-19.0.0" level="project" />
    <orderEntry type="library" exported="" name="universal-image-loader-1.8.6-with-sources" level="project" />
    <orderEntry type="library" exported="" name="libGoogleAnalyticsServices" level="project" />
  </component>
</module>

这篇关于Android Studio中生成APK签上不工作构建0.3.6 - 给错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 15:16