proguard

proguardRelease FAILED when compiling apk with assembleRelease in Android Studio

浪子不回头ぞ 提交于 2019-12-18 03:01:01
问题 I'm trying to compile my app as assembleRelease in Android Studio 1.0.1 and get the following message: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:proguardRelease'. > java.io.IOException: Please correct the above warnings first. The app compiles and runs perfectly in debug mode, and assembleRelease worked with Android Studio 0.8. The proguard-rules.pro file is empty. The build.gradle file and the full error are shown below. Anybody can help?

Proguard keep class names?

爷,独闯天下 提交于 2019-12-17 23:27:08
问题 Hello I am writing an Android app and I have set up Proguard to obfuscate my application. I however use a classloader to dynamically load different extensions to my application. The problem is that these don't load correctly if their names are changed. How do I keep Proguard from obfuscating specific class names? 回答1: Use the -keepnames option in your proguard.cfg Refer to the manual https://www.guardsquare.com/en/proguard/manual/usage#keepoptions: -keepnames class_specification Short for

Android Unit Tests with proguard enabled

ぃ、小莉子 提交于 2019-12-17 23:27:03
问题 I have a problem that Proguard strips out methods of my debug APK (I need to run proguard on debug beccause of method dex file limit), even if they are used in the Test apk. E.g. i use GSON addProeprty method in Unit test, but not in the App apk. This method gets stripped away and causes the test to fail. But i do not want to configure proguard to just keep all of GSOn because of the dex file limit, but also do not want to list all methods seperately. is there a way to tell rpguard to

How can I check/upgrade Proguard version whn using it in Eclipse for Android development?

╄→гoц情女王★ 提交于 2019-12-17 22:19:15
问题 The documentation on this is extremely poor. I understand that ProGuard can be enabled by manually editing "default.properties" in the project's rot directory. And all the settings go into the "proguard.cfg" file in the same place, but I'd like to know which version of ProGuard is being used (I'm using Eclise Indigo). I would also like to be able to upgrade it to the latest versions whenever the are released. But I can't find any reference on how to do it. 回答1: The ProGuard jar is located

Proguard (R8) negate operator not working to keep anything except certain packages

折月煮酒 提交于 2019-12-17 21:22:06
问题 The negator (exclamation mark) in proguard should allow me to keep anthing but the apache libraries: -keep class !org.apache.** According to those answers. That's the way to go: How to negate classname with Proguard Enable Proguard for only two packages in large Android application Android proguard Ignore All Classes except of one Proguard Android do not obfuscate anything except few classes Proguard: How to keep everything except specific condition? Can we shrink all classes but only

Proguard: IllegalArgumentException - Unexpected error while evaluating instruction

核能气质少年 提交于 2019-12-17 20:47:58
问题 I'm trying to build a release apk with the proguard enabled. I'm getting the error below. I will attach the full stacktrace below. Unexpected error while evaluating instruction: Class = [*] Method = [myMethod(Ljava/lang/String;Ljava/util/Map;)V] Instruction = [532] aload_3 v3 Exception = [java.lang.IllegalArgumentException] (Value is not a reference value [proguard.evaluation.value.UnknownIntegerValue]) Unexpected error while performing partial evaluation: Class = [*] Method = [myMethod(Ljava

Android Proguard Duplicate Definition

不羁的心 提交于 2019-12-17 20:46:23
问题 I'm attempting to add a 3rd party library (JmDNS) to my Android project. I created a folder 'libs' under the base project directory, and dropped the jar file in the directory. When I attempt to build he project using Ant (ant release), I receive a 'duplicate definition' notices for what appears to be each class in the JmDNS jar file. .... [proguard] Note: duplicate definition of library class [javax.jmdns.impl.tasks.state.Canceler] [proguard] Note: duplicate definition of library class [javax

Android - Proguard duplicate zip entry error

人走茶凉 提交于 2019-12-17 20:17:09
问题 I am trying to use proguard in an android application which uses a android library project and I am getting the following error : java.io.IOException: Can't write [/private/var/folders/Pg/PgUpPJQ-E5qxL7jX6kpdCE+++TI/-Tmp-/android_3140050575281008652.jar] (Can't read [proguard.ClassPathEntry@1f8d244] (Duplicate zip entry [be.class == android_144638064543155619.jar:com/comp/dp/library/R$anim.class])) at proguard.OutputWriter.writeOutput(OutputWriter.java:224) at proguard.OutputWriter.execute

AndroidStudio 混淆打包

北慕城南 提交于 2019-12-17 19:52:54
AndroidStudio中的项目可以用compile的形式引入github上的开 源项目,可以引用module,而不一定都要用libs文件夹中添加jar包的形式。在最终realease打包时,混淆的设置是比较重要的,否则会导致 生成的包有很多功能不能正常使用。下面列举一个基本的app的build.gradle和混淆文件。并注意,混淆打包后的apk文件大小会比不使用混淆要 小。 在app根目录下设置build.gradle和混淆文件,然后把混淆选项写入混淆文件就可以。虽然app项目中可能引用了一些module,但这些module工程可以不定义自己的混淆,我的工程目录结构如下: 其中app是应用主模块,引用剩余的module,被引用module的build.gradle中都使用默认的设置不启用混淆: buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } 在主目录的build.gradle: apply plugin: 'com.android.application' def releaseTime() { return new Date().format("yyyy-MM-dd"

AndroidStudio 混淆打包

旧街凉风 提交于 2019-12-17 19:52:23
AndroidStudio中的项目可以用compile的形式引入github上的开源项目,可以引用module,而不一定都要用libs文件夹中添加jar包的形式。在最终realease打包时,混淆的设置是比较重要的,否则会导致生成的包有很多功能不能正常使用。下面列举一个基本的app的build.gradle和混淆文件。并注意,混淆打包后的apk文件大小会比不使用混淆要小。 在app根目录下设置build.gradle和混淆文件,然后把混淆选项写入混淆文件就可以。虽然app项目中可能引用了一些module,但这些module工程可以不定义自己的混淆,我的工程目录结构如下: 其中app是应用主模块,引用剩余的module,被引用module的build.gradle中都使用默认的设置不启用混淆: buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } 在主目录的build.gradle: apply plugin: 'com.android.application' def releaseTime() { return new Date().format("yyyy-MM-dd",