久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

EmptyThrowable:磁盤上不存在 APK 文件 *.apk

EmptyThrowable: The APK file *.apk does not exist on disk(EmptyThrowable:磁盤上不存在 APK 文件 *.apk)
本文介紹了EmptyThrowable:磁盤上不存在 APK 文件 *.apk的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

這是一個使用 gradle 的 Android 應(yīng)用程序.點擊運行后,發(fā)現(xiàn)APP_V1.3.4_2016-02-22_11:30:29outputs/apk 中的 _google_play.apk,但事件日志顯示:

This is an Android application using gradle. After clicking Run, I found APP_V1.3.4_2016-02-22_11:30:29_google_play.apk in outputs/apk, but the event log says:

11:30:31 EmptyThrowable:APK 文件/.../WorkSpace/Android/.../app/build/outputs/apk/APP_V1.3.4_2016-02-22_11:30:14_google_play.apk 在磁盤上不存在.

11:30:31 EmptyThrowable: The APK file /.../WorkSpace/Android/.../app/build/outputs/apk/APP_V1.3.4_2016-02-22_11:30:14_google_play.apk does not exist on disk.

11:30:32 會話應(yīng)用程序":安裝 APK 時出錯

11:30:32 Session 'app': Error Installing APK

這是我的 build.gradle 文件:

apply plugin: 'com.android.application'

def releaseTime() {
    return new Date().format("yyyy-MM-dd_HH:mm:ss",
        TimeZone.getTimeZone("GMT+08:00"))
}

android {
    compileSdkVersion 'Google Inc.:Google APIs:23'
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 29
        versionName "1.3.4"
        manifestPlaceholders = [SOME_CHANNEL_VALUE: "some_channel"]
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    signingConfigs {
        debug {}

        release {
            // ...
        }
    }

    buildTypes {
        debug {
            zipAlignEnabled true
            minifyEnabled false
            shrinkResources true
        }

        release {
            zipAlignEnabled true
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'
            signingConfig signingConfigs.release

            applicationVariants.all { variant ->

                def time = releaseTime()

                variant.outputs.each { output ->
                    def apk = output.outputFile
                    def endFileName = "${time}_${variant.productFlavors[0].name}.apk"

                    if (apk != null &&
                        apk.name.endsWith('.apk') &&
                        !apk.name.endsWith('${endFileName}')) {
                        def fileName = "APP_V${defaultConfig.versionName}_${endFileName}"
                        output.outputFile = new File(apk.parentFile, fileName)
                    }
                }
            }
        }
    }

    productFlavors {
        google_play {
            manifestPlaceholders = [SOME_CHANNEL_VALUE: "google_play"]
        }
    }
}

dependencies {
    // ...
}

那么releaseTime()有什么問題嗎?

推薦答案

在我的情況下,問題是要安裝的 apk 的名稱被緩存了,所以每次我嘗試運行應(yīng)用程序時,都會生成一個帶有今天日期的 apk但是在安裝時,Android Studio 會尋找一個舊名稱的 apk 文件.解決方案是點擊Sync Gradle,然后點擊Build > Rebuild Project.您可能還想刪除文件夾 app/apksapp//build/outputs/apk 之前.

In my case the problem was that the name of the apk to be installed was cached, so everytime I tried running the app, an apk with today's date was generated but when installing, Android Studio looked for an apk file with an old name. The solution was to click Sync Gradle and then Build > Rebuild Project. You may also want to delete folders app/apks and app//build/outputs/apk previously.

這篇關(guān)于EmptyThrowable:磁盤上不存在 APK 文件 *.apk的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現(xiàn) IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當(dāng)前風(fēng)味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復(fù)“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風(fēng)味庫的多風(fēng)味應(yīng)用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: av在线免费观看网站 | 久久久久九九九女人毛片 | 成人欧美一区二区三区在线观看 | 色婷婷精品国产一区二区三区 | 天天干夜夜操 | 久久国产精品视频 | 久久久噜噜噜www成人网 | 一区二区不卡高清 | 亚洲一区二区三区乱码aⅴ 四虎在线视频 | 无毛av | 九九久久精品视频 | 337p日本欧洲亚洲大胆鲁鲁 | 亚洲精品免费在线观看 | 久久精品久久久久久 | 免费1区2区3区 | 国产精品一二三区 | 亚洲综合小视频 | 欧美综合一区二区 | 欧美视频1 | 国产激情视频网站 | 午夜免费网站 | 国产在线精品一区二区三区 | 亚洲一二三区不卡 | 成人一区二区在线 | 中文字幕二区 | 久久久精品一区二区三区 | 一级在线观看 | 成人av电影网 | 日韩成人在线电影 | 日本一区二区高清视频 | 99re视频在线观看 | 视频1区| 精品国产乱码久久久久久影片 | 国产高清在线观看 | 国产视频二区在线观看 | 免费日韩网站 | 91精品久久久久久久久中文字幕 | 日韩不卡视频在线观看 | 国产精品国产精品国产专区不卡 | 中文字幕在线中文 | 亚洲欧美激情精品一区二区 |