components.flags文件中未生成任何插件

问题描述 投票:0回答:1

我在我的[[gradle中添加了收缩选项,而总是发生以下错误:

:app:shrinkDefaultConfigDebugMultiDexComponents FAILED Error:Execution failed for task :app:shrinkDefaultConfigDebugMultiDexComponents'. java.io.IOException: The output jar [[mypath]/componentClasses.jar] must be specified after an input jar, or it will be empty.
这里是我的

gradle config

debug{ project.archivesBaseName = "zcctest131" signingConfig signingConfigs.myConfig minifyEnabled true shrinkResources true }
而且我也将multidex选项启用为:

multiDexEnabled = true

编译'com.android.support:multidex:1.0.1'

通过检查生成的component.flags文件(其路径为app/build/intermediates/multi-dex/defaultConfig/debug/components.jar,我发现第一行成为:

outjars /Users/zcc/app/build/intermediates/multi-dex/defaultConfig/debug/componentClasses.jar

The:

injars /Users/zcc/app/build/intermediates/multi-dex/anZhi/release/allclasses.jar

丢失,导致IOException

Proguard源代码如下,供您参考:

/** * Reads the input jars (or directories). */ private void readInput() throws IOException { if (configuration.verbose) { System.out.println("Reading jars..."); } // Check if we have at least some program jars. if (configuration.programJars == null) { throw new IOException("The input is empty. You have to specify one or more '-injars' options."); } // Read the input program jars. readInput("Reading program ", configuration.programJars, createDataEntryClassPoolFiller(false));

...

http://proguard.sourceforge.net/quality/compatibility/code/proguard/ProGuard.html

我该如何解决?非常感谢。

android proguard shrink
1个回答
0
投票
正确的方法是在构建类型中而不是在Flavors块中添加proguard规则文件。然后问题解决了。
© www.soinside.com 2019 - 2024. All rights reserved.