2016-09-28 61 views
1

當我使用progurad選項運行mvn install目標時,出現以下錯誤。以前,我沒有這個錯誤。我找不到什麼使中得到以下錯誤的區別是:proguard.ParseException:proguard.cfg中的未知選項'-encryptstrings'

proguard.ParseException: Unknown option '-encryptstrings' in line .. of file 'proguard.cfg' 

我使用dexguard我的項目。是因爲maven無法識別dexguard文件夾位置而導致此錯誤?

proguard.cfg內容:

-dalvik -- unknown option 
-android -- unknown option 
# Encrypt all strings -- parse exception 
-encryptstrings '???*' 
以下工作與超時問題:
-dontusemixedcaseclassnames 
-dontskipnonpubliclibraryclasses 
-dontpreverify 
-verbose 
-optimizations !code/simplification/arithmetic 
-optimizationpasses 30 
-allowaccessmodification 
-dontpreverify 
-dontoptimize 
-ignorewarnings 
-renamesourcefileattribute Maviance 
-keepattributes SourceFile,LineNumberTable,*Annotation* 
-keep,allowshrinking,allowobfuscation class android.support.**Compat* { *; } 
+0

我有同樣的問題,但我用dexguard和gradle這個似乎用proguard的,而不是 –

回答

1

選項-encryptstrings '???*'僅由DexGuard支持。因此,當您使用ProGuard構建應用程序時,您將收到此類錯誤。

因此,建議將dexguard相關配置分隔成一個單獨的配置文件dexguard-project.txt,該配置文件僅在使用DexGuard時才包含。

+0

謝謝。我已經轉移到dexguard-project.txt文件。我如何讓maven考慮這個文件? – kommuru

0

我有使用dexguard相同的錯誤。問題是,我錯過了這條線

  proguardFiles getDefaultDexGuardFile('dexguard-debug.pro') 

所以gradle這個了,而不是Dexguard Proguard的,這顯然doesn't有encryptstrings功能。所以工作發佈配置是這樣的:

release { 
      debuggable true 
      minifyEnabled true 
      proguardFiles getDefaultDexGuardFile('dexguard-debug.pro') 
      signingConfig signingConfigs.release 
     } 
相關問題