proguard

Using GSON with proguard enabled

痴心易碎 提交于 2019-11-27 12:43:36
My code works perfectly without proguard, but GSON doesn't work when proguard is enabled. This is the part of code where it doesn't works JSONArray mensaje = response.getJSONArray("categorias"); // Parsear con Gson Categorias[] categorias = gson.fromJson(mensaje.toString(), Categorias[].class); Log.d("mainfragment","desc categoria "+categorias[0].getDescripcionCategoria()); mainfragment's log prints null # Output D/Dato categorias﹕ Respuesta: {"categorias":[{"idCategoria":"22","imagenCategoria":"ic_aseguradora","descripcionCategoria":"Aseguradoras"},{"idCategoria":"24","imagenCategoria":"ic

Gradle failed to build when proguard is activated

◇◆丶佛笑我妖孽 提交于 2019-11-27 12:33:27
I am trying to release my Android application with Gradle. Everything works, including the ./gradlew clean build assembleRelease command. However, as soon as I try to use proguard, Gradle fail to build the release version. Here is the error I get (stack trace activated): ... :OSkin:validateDebugSigning :OSkin:packageDebug :OSkin:assembleDebug :OSkin:prepareReleaseDependencies :OSkin:compileReleaseAidl :OSkin:generateReleaseBuildConfig :OSkin:mergeReleaseAssets :OSkin:compileReleaseRenderscript :OSkin:mergeReleaseResources :OSkin:processReleaseManifest :OSkin:processReleaseResources :OSkin

Using Proguard with Android without obfuscation

不羁岁月 提交于 2019-11-27 12:19:35
问题 I am getting an error "Conversion to Dalvik format failed with error 1" when using the -dontobfuscate flag. Otherwise my app exports fine. I don't want to obfuscate because I am using BugSense for error tracking and they charge $99 a month if you need to de-obfuscate your stack traces. I still want to get the file size and optimization benefits of proguard. If I comment out -dontobfuscate every thing works great. Except for the unreadable stack traces. my progaurd.cfg file: -dontobfuscate

Prevent class member name obfuscation by ProGuard

孤人 提交于 2019-11-27 11:52:25
I have my class ClassMultiPoint with subclasses. public class ClassMultiPoints { public String message; public List<ClassPoints> data; public class ClassPoints { public String id; public List<ClassPoint> points; public class ClassPoint { public String speed; public String bearing; } } } I will get value of object oPoints from parse GSON : oPoints = gson.fromJson( jsonString, ClassMultiPoints.class); I try use oPoints.message . When I run my application without proguard app run success. When I run my app with proguard my app crash. I think problem is: proguard rename attribute 'oPoints.message'

Maven, Proguard and assembly issues

余生长醉 提交于 2019-11-27 11:42:07
问题 I'm trying to get Maven working with ProGuard. What I want to achieve is the following: Run ProGuard over my source files and produce obfuscated classes Create a manifest file that references the main class so that I can execute it as a jar Unpack all of the associated library jars and create one huge jar containing them all. This file should only contact .class and .xml files only. Assemble them into .zip and tar.gz files that include various README.txt files and so on. So far I've got

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

Proguard returned with error code 1. See console

对着背影说爱祢 提交于 2019-11-27 10:49:09
问题 I am receiving this exception while creation of signed apk of my application. I have 5 library projects added to my project as well. Any hint how to resolve this issue? Here is my config file: -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class *

Android ProGuard return Line Number

馋奶兔 提交于 2019-11-27 10:29:48
问题 Is there a way to get ProGuard to return a line number where the crash happened? I can use retrace to get to the method, but often for things like NullPointerException there are too many possibilities and in a large piece of code its extremely hard to determine the underlying cause as you have to check every object and it's life cycle to make sure nothing is wrong. It would really help if ProGuard could narrow this down to a line number for me. 回答1: Add this line to your proguard-project.txt

Why start using -libraryjars when I never needed it before?

房东的猫 提交于 2019-11-27 09:26:12
Since I updated ADT from 16 to 18 (which mandated Proguard update from 4.6 to 4.8), Proguard has been acting very weirdly (and inconsistently?). The latest such problem is when I try to export a signed (release) APK, I receive the following errors: Proguard returned with error code 1. See console Warning: com.bta.LibProj2: can't find referenced class com.bta.R$string Warning: com.bta.MyDlg1: can't find referenced class com.bta.R$string Warning: com.bta.MyMenu: can't find referenced class com.bta.R$menu Warning: com.bta.R: can't find referenced class com.bta.R$attr Warning: com.bta.R: can't

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