Skip to content

Commit

Permalink
Proguard not working
Browse files Browse the repository at this point in the history
  • Loading branch information
mirland committed May 22, 2019
1 parent ca55bc2 commit 0325ee7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
10 changes: 7 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions goSellSDKSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,18 @@ android {
vectorDrawables.useSupportLibrary = true

}

signingConfigs {
garbage_key {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('/$HOME/.android/debug.keystore')
storePassword 'android'
}
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true
signingConfig signingConfigs.garbage_key
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
customDebugType {
Expand Down
20 changes: 20 additions & 0 deletions goSellSDKSample/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,23 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

#########################################################################
# Retrofit 2
#########################################################################
-keepattributes Signature
-keepclassmembernames,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement


#########################################################################
# OkHttp
#########################################################################
-dontwarn okhttp3.**
-dontwarn okhttp2.**
-dontwarn okio.**
-dontwarn javax.annotation.**
-dontwarn org.conscrypt.**
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

2 comments on commit 0325ee7

@HaithamSheshtawy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the reason is one of two:

  1. If you have an older installation on your phone(with a debug key), please uninstall it first. (You can't have the same app with two different signatures on your device)

  2. Assuming you're keeping ADT up to date.
    If you're building the release version of your application using Eclipse export, it will load Proguard settings from the file specified by the proguard.config property in project.properties.

If you are using ant release, it will load the Proguard settings from the file specified by the proguard.config property in ant.properties.

That being said, are you getting any kind of errors or warnings during your build? These are especially helpful when diagnosing Proguard since it's purpose is to remove classes and methods that it doesn't think are being used by your application.

@mirland
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting a crash, if you run this example you will get the same crash.

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
       at gotap.com.tapglkitandroid.gl.Views.TapRender.onSurfaceCreated(TapRender.java:50)
       at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1521)
       at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1253)

Please sign in to comment.