android-proguard

gradle generate error when minifying the code

妖精的绣舞 提交于 2019-12-11 11:34:24
问题 when i try to set the minifyEnabled to true and try to sync gradle file i receive the follwoing error: Error:Cause: com/android/build/gradle/tasks/AndroidProGuardTask why i am receiving this error and how to solve it, I cant enable proGaurd in Android Studio. build.gradle : buildTypes { debug { debuggable true } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } 回答1: are you using any external library files in your project? If

How to get list of stripped by Proguard methods and classes?

旧时模样 提交于 2019-12-11 02:34:07
问题 Proguard removes unused methods and classes during optimization. How to get list of them? 回答1: I think you should use printusage As per proguard -printusage [filename] Specifies to list dead code of the input class files. The list is printed to the standard output or to the given file. For example, you can list the unused code of an application. Only applicable when shrinking. This is code which will be removed at the time of optimization, though you can also control optimization process. 来源:

How to remove proguard file from inherit proguardFiles?

丶灬走出姿态 提交于 2019-12-11 02:06:55
问题 I have 2 buildTypes below: debug { ... proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-rules-dont-obfuscate.pro' ... } inhouse.initWith(buildTypes.debug) inhouse { ... proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' println proguardFiles.toString() ... } I want my inhouse buildType inherited from debug (for other properties) but not to include proguard file proguard-rules-dont-obfuscate.pro as seen above.

proguard - dupe zip entry ( after upgraded facebook parse UI lib to v4 )

纵然是瞬间 提交于 2019-12-11 01:52:19
问题 ---SOLVED : deleted 2 lines from :app:build.gradle--- compile files('ParseLoginUI/libs/Parse-1.9.1.jar') compile files('ParseLoginUI/libs/ParseFacebookUtilsV4-1.9.1.jar') the lib comment here can be interpreted as "you need these 2 statements in your proj.root.build.gradle. Well not true. I had to delete those in order not to get 'dupe zip' errors from proguard. --Solved-- Upgrade of parseUI library from v3 to v4 went fine til i tried to run proguard within gradle "assembleRelease" task.

proguard doesn't remove logs

谁说胖子不能爱 提交于 2019-12-11 01:47:21
问题 In proguard-rules.pro , I have following configuration: -assumenosideeffects class android.util.Log { public static boolean isLoggable(java.lang.String, int); public static int v(...); public static int d(...); public static int i(...); } In my gradle build , I enable proguard only for release build: buildTypes { debug { debuggable true minifyEnabled false signingConfig signingConfigs.debug } release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard

What does the exclamation mark before class path do in ProGuard?

守給你的承諾、 提交于 2019-12-10 22:15:04
问题 I studying the Proguard now but im confused with the exclamation mark ! before the classpath in the settings, such as: -keep class !android.support.v7.view.menu. {*;}** what does this "!" do? does it mean that proguard will not keep this class? but if thats so why do we need it since proguard will obfuscate all the classes? 回答1: It means the same thing that ! means in many other programming languages. It negates the selection that follows. So in your example, the keep directive will apply to

Cordova and proguard : Camera Plugin NPE on takePicture

孤人 提交于 2019-12-10 21:50:51
问题 sorry if someone already asked for this. I'm very new on Stack, and i didn't found a solution. Here is the stack i get form the usage of my app after I minified it. 08-29 13:27:30.330 10037-10192/? E/PluginManager: Uncaught exception from plugin java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.PackageItemInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference at android

Run espresso tests after proguard

倾然丶 夕夏残阳落幕 提交于 2019-12-10 20:36:49
问题 I am searching a way to run my espresso-tests after proguard was running - This should be a safety-net for a miss-configured proguard ( just had this after updating butterknife to 7.0 and forgot to update the proguard config ) 回答1: Assuming that you are proguarding your APK using the standard mechanisms built into the Android Gradle build system (setting 'minifyEnabled true' for a particular buildType), you can test your 'proguarded' APK by setting the testBuildType as described here and

Execution failed for task ':app:transformClassesWithMultidexlistForRelease'

廉价感情. 提交于 2019-12-10 18:33:28
问题 I am getting this error in gradle console when I remove the line --dontobfsucate from my proguard rule file. Otherwise I am able to successfully generate the apk. I was previously facing this problem before My Previous Problem. But i was able to resolve that by options --stacktrace --debug . I think I have removed redundant grade redundancies. 13:10:41.397 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 13:10:41.397 [ERROR] [org.gradle

Proguard doesnt obfuscate Class name, only methods are obfuscated

我只是一个虾纸丫 提交于 2019-12-10 16:46:30
问题 I try using Proguard in android studio, but seems like Proguard is not obfuscating the class name, for example, my app structure, and the config: and config but when i try trigger the exception in the app: the exception is listed in ADB console: only the methods are obfuscated, the MainActivity.class is not 回答1: This is an expected behaviour because the class is an activity ! All classes that are mentioned in AndroidManifest.xml have to keep their names (activities, services, providers,