You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio Arctic Fox升级Dolphin后签名APK生成成功却找不到路径

Android Studio Dolphin升级后签名APK生成成功但找不到文件的问题

将Android Studio从Arctic Fox升级到Dolphin版本后,执行生成签名APK操作时,收到提示:

Generate Signed APK: APK(s) generated successfully for module 'test_app.app' with 0 build variants

但无论在指定输出路径还是app\build\outputs\apk\debug目录下都找不到生成的APK文件。此前在Arctic Fox版本中该功能正常,且仅签名APK存在此问题,AAB文件生成完全正常。

用户提供的gradle配置如下:

apply plugin: 'com.android.application'
//apply plugin: 'com.android.library'

android {
    compileSdkVersion 30
    buildToolsVersion '29.0.3'
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "com.entitcs.office_attendance"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 63
        versionName "2.48"
        multiDexEnabled true
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
    }

    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable false
            //signingConfig signingConfigs.config
            //signingConfig signingConfigs.config
        }
    }

    productFlavors {}
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

解决方法

  • 修复签名配置关联:当前gradle中release构建类型的signingConfig被注释,且缺少signingConfigs配置块。取消注释//signingConfig signingConfigs.config,并补充签名配置:

    signingConfigs {
        config {
            storeFile file('你的密钥库路径.jks')
            storePassword '密钥库密码'
            keyAlias '密钥别名'
            keyPassword '密钥密码'
        }
    }
    

    确保release块中启用signingConfig signingConfigs.config。

  • 确认构建变体选择:生成签名APK时,务必选中release变体(当前仅配置了release的混淆规则,debug未配置签名),Dolphin版本的变体选择界面位置可能有调整,需仔细确认。

  • 清理缓存后重建:执行Build > Clean Project,再执行Build > Rebuild Project,排除缓存导致的构建异常,之后重新尝试生成签名APK。

  • 检查正确的输出目录:签名APK默认生成在app/build/outputs/apk/release目录(而非debug目录),可切换Android Studio的Project视图为Project Files模式直接查看该路径;也可在生成弹窗中点击Browse确认输出路径是否正确。

  • 同步Build Tools版本:当前buildToolsVersion '29.0.3'与compileSdkVersion 30不匹配,建议将buildToolsVersion更新为30.0.3,避免版本兼容问题。

内容的提问来源于stack exchange,提问作者Shyam Sunder

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 08:30:50