android-proguard

What's the difference between “minifyEnabled” and “useProguard” in the Android Plugin for Gradle?

旧巷老猫 提交于 2019-11-28 06:42:36
I see that the Android Plugin for Gradle has a minifyEnabled property as well as a useProguard property, as follows: android { buildTypes { debug { minifyEnabled true useProguard false } release { minifyEnabled true useProguard true } } } What's the difference between these two properties? Or, rather, what's the meaning of each? Quoting from tools.android.com : Built-in shrinker Version 2.0 of Android Plugin for Gradle ships with an experimental built-in code shrinker, which can be used instead of ProGuard. The built-in shrinker supports fast incremental runs and is meant to speed up iteration

Proguard issue “Warning:Ignoring InnerClasses attribute for an anonymous inner class”

心已入冬 提交于 2019-11-28 04:37:57
I don't know how I can describe this issue. I searched a lot, but I didn't find any solution. Also this solution did not help me -keepattributes EnclosingMethod : dependencies { compile project(':libraries:material-drawer') compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.0' compile 'com.android.support:recyclerview-v7:23.2.0' compile 'com.android.support:design:23.2.0' compile 'com.google.code.gson:gson:2.4' compile 'com.mcxiaoke.volley:library:1.0.19' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com

ProGuard: “java.exe” exited with code 1 after adding ModernHTTPClient

坚强是说给别人听的谎言 提交于 2019-11-28 02:21:30
问题 In the Xamarin.Forms project I added ModernHTTPClient library and now the ProGuard step breaks with error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2025,3): error MSB6006: "java.exe" exited with code 1. (Previously, I had some issues with ProGuard but was able to get it to work while targeting Android 7.1 by upgrading ProGuard to latest version.) Some of the details from the log file are below. 2> Proguard (TaskId

build failing on play-services:11.8.x with pro guard parser error

柔情痞子 提交于 2019-11-27 17:58:19
So it looks like there is a bug in the latest play-services to be deployed. Does anyone know how to work around this issue? FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':myappname:transformClassesWithAndroidGradleClassShrinkerForDevelopmentDebug'. > ProGuard configuration parser error: /Users/myusername/.gradle/caches/transforms-1/files-1.1/play-services-base-11.8.0.aar/d2ad9e16677fda9cf07a1280a66e91ca/proguard.txt line 3:88 no viable alternative at input '<fields>' So more information. seems the problem is in the core module: Error:Execution failed

Xamarin Android ProGuard Enable

孤街醉人 提交于 2019-11-27 16:36:51
问题 i am working on xamarin application. When i enable "ProGuard" in android properties, while building the application, I'm getting the following error: "java.exe" exited with code1. proguard cfg file has the following: -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class * extends android.app.Service Developing Environment: Visual Studio 2015 Xamarin 4.0.4.4 回答1: I had the same issue when enabling ProGuard. By following the

Updating Play services from 8.1 to 8.3 with Proguard enabled

寵の児 提交于 2019-11-27 13:37:56
问题 I tried to update play services to 8.3. Here's what I changed : In the root gradle file : dependencies { classpath 'com.android.tools.build:gradle:1.5.0-beta1' classpath 'com.google.gms:google-services:1.5.0-beta2' } And in the app gradle file : compile 'com.google.android.gms:play-services-maps:8.3.0' compile 'com.google.android.gms:play-services-location:8.3.0' compile 'com.google.android.gms:play-services-base:8.3.0' compile 'com.google.android.gms:play-services-gcm:8.3.0' compile 'com

ProGuard: duplicate definition of library class?

守給你的承諾、 提交于 2019-11-27 11:24:37
问题 I run my ProGuard for my Android project and get the following warnings: Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver] Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory] Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException] Note: duplicate definition of library class [org.apache.http.params.HttpParams] Note: duplicate definition of library class [android.net.http

Android/java: Transition / Migration from ProGuard to R8?

為{幸葍}努か 提交于 2019-11-27 09:25:19
I wonder how to make the transition / migration from ProGuard to R8 . Should I just remove the Proguard-related lines from my Gradle files and add the android.enableR8 = true line instead ? Thanks. shizhen Proguard is developed and maintained by GuardSquare while R8 is developed and maintained by Android team which means they are two different products although R8 is compatible with Proguard. As seen from here https://www.guardsquare.com/en/blog/proguard-and-r8 Compatibility of ProGuard and R8 The good news for developers is that R8 is backward compatible with ProGuard. If you have a working

How do I shrink Android code with Proguard

半腔热情 提交于 2019-11-27 07:30:42
问题 Since I am using many dependencies in my app, I am reaching the 65k Method Limit (I am reaching 76k methods). I've read on android.developer that proguard is used to shrink the code. So - does proguard only shrink my application code or does it shrink the code of my dependencies too? Do I need to be wary of something when shrinking code with proguard? How do I do that? My Gradle Build: apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2"

Hide a library source code

旧巷老猫 提交于 2019-11-27 06:22:39
问题 I am developing an android library and I want to hide it's code. I am using other library, and for some of them, when trying to access their code with Android Studio, you only get the list of methods of the class and "/ * compiled code* /" inside. I am using pro-guard, but i can still access the source code of my library. Even if the methods and members names have been modified, the code is still readable and it is possible to read every hard coded strings. How do I hide my code the same way