Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build.gradle 没有配置 signingConfigs 时构建失败 #88

Open
drumge opened this issue Dec 5, 2022 · 2 comments
Open

build.gradle 没有配置 signingConfigs 时构建失败 #88

drumge opened this issue Dec 5, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@drumge
Copy link

drumge commented Dec 5, 2022

失败堆栈如下:

Caused by: java.lang.NullPointerException
 	at com.bytedance.android.plugin.internal.SigningConfigResolutionKt.getSigningConfigByAppVariant(SigningConfigResolution.kt:37)
 	at com.bytedance.android.plugin.internal.SigningConfigResolutionKt.getSigningConfigForAGP4(SigningConfigResolution.kt:33)
 	at com.bytedance.android.plugin.internal.SigningConfigResolutionKt.getSigningConfig(SigningConfigResolution.kt:23)
 	at com.bytedance.android.plugin.tasks.AabResGuardTask.execute(AabResGuardTask.kt:48)

image

从 `SigningConfig` 这个定义看,`storeFile` 等字段都是可以为null,是不是可以理解为设计上允许不设置 signingConfigs 的,但是 `SigningConfigResolution#getSigningConfigByAppVariant `中的 `variant.signingConfig` 是可能会为 null 的, gradle api 可能为null的部分代码如下
    @Override
    public SigningConfig getSigningConfig() {
        return readOnlyObjectProvider.getSigningConfig(
                component.getVariantDslInfo().getSigningConfig());
    }
    @Nullable
    public SigningConfig getSigningConfig(@Nullable SigningConfig signingConfig) {
        if (signingConfig == null) {
            return null;
        }

        SigningConfig readOnlySigningConfig = this.readOnlySigningConfig.get(signingConfig);
        if (readOnlySigningConfig == null) {
            this.readOnlySigningConfig.put(signingConfig,
                    readOnlySigningConfig = new ReadOnlySigningConfig(signingConfig));
        }

        return readOnlySigningConfig;
    }
@drumge drumge added the bug Something isn't working label Dec 5, 2022
@litchi98
Copy link

一样的问题, 请问有解决方案了吗

@hanliuxin5
Copy link

如果只是想在没有密钥的情况下看输出文件的话,建议 bundleDebug 就行。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants