Android Studio 不生成签名的 apk [英] Android studio not generate signed apk

查看:113
本文介绍了Android Studio 不生成签名的 apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我将我正在使用的 android studio IDE 更新为 Android Studio 1.5.1.但现在我遇到了一些麻烦,因为更新后它没有生成签名的 apk 文件.但是当我插入设备并运行该应用程序时,它运行正常.当我使用

recently I updated my working android studio IDE into Android Studio 1.5.1. but now I'm facing some trouble as after updating it did not generating signed apk file. but when I plug a device and run the app, it runs properly. when I use

构建 -> 生成签名 Apk

Build -> Generate Signed Apk

在事件日志中显示

10:38:51 AM Executing tasks: [:app:assembleRelease]

滑块显示一段时间后消失.它也不显示构建生成完成对话框.然后我更改构建变体并尝试使用连接的设备运行该应用程序.并在事件日志中播种

and the slider shows some time and it disappear. It does not show build generation completion dialog too. then I change build variant and try to run the app using a connected device. and in the Event Log it sows

10:43:32 AM Executing tasks: [:app:assembleDebug]

几秒钟后,一个弹出消息说 Apk(s) 生成成功,但签名的 apk 仍然不在相关文件夹中.并且该应用程序在设备中正常运行.我的完整事件日志如下.

after few seconds a pop up coms saying Apk(s) generated successfully, but still the signed apk is not there at the relavent folder. and the app runs in the device properly. and my full Event Log is as follow.

10:38:51 AM Executing tasks: [:app:assembleRelease]
10:43:32 AM Executing tasks: [:app:assembleDebug]
10:43:46 AM Gradle build finished in 13s 964ms
10:43:46 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:46 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:46 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:46 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:47 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:47 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:47 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:52 AM Session 'app': Launched on samsung-sm_t211-4100cede9628b000

我的 build.gradel 文件也如下.

also my build.gradel file is as following.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion '23.0.0 rc3'
    defaultConfig {
        applicationId "com.lf"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 63
        versionName '2.0.9'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile 'com.android.support:support-v4:22.2.1'
    compile project(':holoColorPickermaster')
    compile project(':qRCodeReaderViewlib')
    compile project(':volley')
    compile project(':library')
}

那么我该如何解决这个问题.发生这种情况后,我完全更新了 Android Studio,但它仍然相同.

so how can I fix this. I fully update Android studio after this was happen and it still the same.

推荐答案

我通过完全删除 Android studio 及其相关文件并重新安装来解决此问题.现在它的工作完美.我在 IDE 中使用的插件可能存在一些问题.因此,在我的 ma​​c 中,我使用以下 终端命令 删除了 android studio

I fixed this issue by completely removing Android studio and it's related files and re install it. and now its working perfectly. it may be some issue with the plugins I'm using with the IDE. So in my mac I used following terminal commands to remove android studio

rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
rm -Rf ~/.gradle
rm -Rf ~/.android

然后我重新安装IDE并安装必要的SDK.为我解决了这个问题.

then I re install the IDE and install necessary SDKs. this fixed issue for me.

这篇关于Android Studio 不生成签名的 apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆