proguard

Dagger cannot create object graph although it can produce dot file

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 13:43:00
问题 I'm struggling with the setup of Dagger (1.0.1), in a existing application. It was configured to use ProGuard but I disabled it for this test with -dontobfuscate . When I enable dagger-compiler it's able to successfully generate a dot file with the dependencies graph, but when I remove the compiler and build the app in Release mode it crashes during startup, complaining that it's unable to create the object graph. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.corp

When using Proguard, do you need a separate config for each referenced library?

梦想的初衷 提交于 2019-12-03 13:40:58
问题 My application has references to HoloEverywhere and SherlockActionBar, both which are in-workspace projects. When I enabled Proguard for the application only, it crashes giving these errors: 11-15 11:50:11.090: E/AndroidRuntime(24823): Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.app.Activity, int] 11-15 11:50:11.090: E/AndroidRuntime(24823): at com.actionbarsherlock.a.a(Unknown Source) 11-15 11:50:11.090: E/AndroidRuntime(24823): at org

Proguard doesnt preserve the line numbers and method names in stacktrace

六月ゝ 毕业季﹏ 提交于 2019-12-03 13:13:00
Here are few lines from proguard-rules.pro -keepattributes *Annotation* -keepattributes Signature -keepattributes InnerClasses,EnclosingMethod -renamesourcefileattribute SourceFile -keepattributes SourceFile,LineNumberTable -keep public class * extends java.lang.Exception -dontwarn org.apache.http.** Logcat output (error line number is listed as 1133, while my source file is 100 lines longer) 09-04 16:11:46.698 3827-5280/com.XX.main E/AndroidRuntime: FATAL EXCEPTION: IntentService[ActivityRecognizedTracker] Process: com.XX.main, PID: 3827 java.lang.NullPointerException: Attempt to read from

Remove Logging with Proguard

假装没事ソ 提交于 2019-12-03 13:00:13
问题 I am trying to remove the log statements without success. Other SO answers to the same question refer to Eclipse or to an old Android Studio IDE (Intellij). build.gradle buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } ... proguard-rules.pro -assumenosideeffects class android.util.Log { public static *** d(...); public static *** v(...); public static *** i(...); public static *** w(...); public static *** e(...); }

ProGuard can cause incorrect calculations

南楼画角 提交于 2019-12-03 12:19:54
I have met a pretty strange bug. The following small piece of code uses a rather simple math. protected double C_n_k(int n, int k) { if(k<0 || k>n) return 0; double s=1; for(int i=1;i<=k;i++) s=s*(n+1-i)/i; return s; } Edit Using ProGuard can make it go wrong on some devices. I have it confirmed on HTC One S Android 4.1.1 build 3.16.401.8, but judging by e-mails I got, a lot of phones with Android 4+ are affected. For some of them (Galaxy S3), american operator-branded phones are affected, while international versions are not. Many phones are not affected. Below is the code of activity which

Android - App crashes on Pre-Lollipop devices

蹲街弑〆低调 提交于 2019-12-03 12:15:52
问题 My app is running well on Lollipop devices but it keep crashing on prior to version Lollipop. I have simply implemented a banner add in my application with the following code through google documention // Request for Ads AdRequest adRequest = new AdRequest.Builder() // Add a test device to show Test Ads .addTestDevice(AdRequest.DEVICE_ID_EMULATOR) .build(); // Load ads into Banner Ads mAdView.loadAd(adRequest); using compileSdkVersion 23 buildToolsVersion "23.0.1" manifest <meta-data android

Proguard - do not obfuscate Kotlin data classes

与世无争的帅哥 提交于 2019-12-03 11:17:25
问题 In my project I use AutoValue for my old model classes. I started using Kotlin and I want to use Data Classes instead of AutoValue. I want to disable the obfuscation for all Data classes in my Data layer but to keep obfuscating the other classes in the package. Is there a way to do this? I would expect to have something like this in my Proguard file: -keepclassmembers data class example.data_layer.** { *; } 回答1: To fix the problem I moved the model classes to model package and added new

“Application stopped working” after enabling Proguard

﹥>﹥吖頭↗ 提交于 2019-12-03 10:58:46
It was a working app, both on emulator and the device i am testing on. But now, i enabled Proguard and Exported the signed app using Android-Tools > Export signed application Then i copied this .apk on to the SD card and tried to install on the Device. But the application stopped working, asking for force close if i try to open it. It works on the device if i run from Eclipse. Since, its said: Proguard has effect only when you export a release .apk file. I checked it, and the apk file size in the bin folder is 1.8mb where as the 1 i got after exporting is 1.4mb . Seems like Proguard has done

Proguard can't find referenced class com.google.ads.internal.state.AdState

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 10:30:40
Ok guys so this becoming extremely annoying trying to get my project to work when exporting/ Progaurd keeps giving me this error: Proguard returned with error code 1. See console Here is the full error i get in the console: Warning: com.google.ads.m: can't find referenced class com.google.ads.internal.state.AdState [2012-10-23 18:14:20 - com.fttech.monkey_toss.Menu] Warning: com.google.ads.m: can't find referenced class com.google.ads.internal.state.AdState [2012-10-23 18:14:20 - com.fttech.monkey_toss.Menu] You should check if you need to specify additional program jars. [2012-10-23 18:14:20

Working maven obfuscate example

本秂侑毒 提交于 2019-12-03 10:16:45
问题 I just want to obfuscate simple maven java app. I use maven-proguard-plugin. All classes main/java must be obfuscated. I try different configs with no luck. The last is: <build> <plugins> <plugin> <groupId>com.github.wvengen</groupId> <artifactId>proguard-maven-plugin</artifactId> <version>2.0.6</version> <dependencies> <dependency> <groupId>net.sf.proguard</groupId> <artifactId>proguard-base</artifactId> <version>4.10</version> <scope>runtime</scope> </dependency> </dependencies> <executions