logo
down
shadow

Enable Proguard on Android Library Project


Enable Proguard on Android Library Project

By : Matti2ed
Date : November 18 2020, 11:13 AM
hop of those help? I have a standalone Android Library Project and I would like to compile this project with Proguard enabled. I'm using Android Studio 1.0 and I have enabled Proguard with minifyEnabled true. However after a clean build I get the following error , I added the following proguard rules
code :
-keep public class * {
    public *;
}

-keepclassmembers class * {
    public *;
}

-keepattributes Exceptions,InnerClasses


Share : facebook icon twitter icon
stopping proguard damaging annotations in android library project

stopping proguard damaging annotations in android library project


By : Kaynat Quayyum
Date : March 29 2020, 07:55 AM
help you fix your problem I am using GREE sdk for social stuff in my game. While exporting signed apk, proguard messes up some custom annotations in GREE sdk. (I am using GREE sdk as a library project in my game) , This worked for me
code :
################### GREE SDK ##################
-keepclassmembers,allowobfuscation class * {
    @net.gree.asdk.core.inject.Inject <fields>;
    @net.gree.asdk.core.inject.Inject <init>(...);
}


##################### GSON #####################
-keepattributes Signature
-keep class sun.misc.Unsafe { *; }

 # Model classes parsed by GSON
-keep class net.gree.asdk.** {
    public protected private *;
}
How to integrating proguard in android having other project as library?

How to integrating proguard in android having other project as library?


By : 4egis
Date : March 29 2020, 07:55 AM
this one helps. Most projects will include a list of ProGuard rules they need added in order to function correctly.
If they don't you will need to play some hit and miss until you get a good compile (and decent size reduction).
code :
-keepclassmembers class **.R$* {
    public static <fields>;
}
Couldn't build android gradle with Crashlytics 2.6.7 and io.branch.sdk.android.library:2+ while proguard enable?

Couldn't build android gradle with Crashlytics 2.6.7 and io.branch.sdk.android.library:2+ while proguard enable?


By : rzarakta
Date : March 29 2020, 07:55 AM
it helps some times since the error message is indicating that some of the 'answers-shim' classes duplicate, one is from crashlytics and another one from io.branch itself, What I have done is, exclude the io.branch module 'answers-shim' by editting the gradle file below.
code :
compile('io.branch.sdk.android:library:2.+') {
    transitive = true;
    exclude module: 'answers-shim'
}
-dontwarn com.crashlytics.android.answers.shim.**
Android Library project OkHttp3 proguard

Android Library project OkHttp3 proguard


By : Andriy
Date : March 29 2020, 07:55 AM
wish help you to fix your issue After much searching I came across the answer in a comment on GitHub: https://github.com/square/retrofit/issues/117
I had to use:
code :
 buildTypes {
        release {
            debuggable false
            minifyEnabled false
            useProguard true
            consumerProguardFiles 'proguard-rules.pro'
        }
    }
Can't enable Proguard on Android project containing jsch lib

Can't enable Proguard on Android project containing jsch lib


By : John Riley
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , After a bit more investigation, I found the following...
I had forgotten to include jzlib-1.1.1.jar in the project with the corresponding
Related Posts Related Posts :
  • How to solve different Preview/Picture sizes returned by android.hardware.camera?
  • How to get songs from album/Artist in android,using MediametadataRetriever?
  • Android UIAutomator how to tilt device
  • DialogFragment issues with screen orientation and MediaController
  • blank screen after re-starting launcher activity (failed binder transaction)
  • How to start activity Language and input
  • location-based Augmented Reality Framework (Android, iOS) with 3D Models?
  • android teamviewer intent with parameters
  • Picasso does not call onBitmapLoaded for the first time
  • How can I pass an audio file as input instead of recorded voice to Google search voice?
  • How to set `ImageView`'s height to match it's width while `layout_weight` is set?
  • How to run a task once, only on installing, on android
  • ADT - Android SDK manager shows update installed with a red mark
  • Android: how to show two activity in one window using java code (not using .xml)
  • How to do independently scrolling rows and columns (a la Netflix app) on Android in a WebView?
  • Sending Data between Activities in Android periodically.
  • Classcastexception achartengine
  • Google Play shows no supported devices
  • OkHttp3 is returning timeout exception
  • What is the best camera parameters for android camera opened in surface view
  • how do i update the database table on the basis of checkbox/unchecked
  • Placeholder for contacts without name in listview
  • Storing username and password in plain text
  • Android Material default colors
  • Android studio importing in gradle issue
  • syntax error (code 1): , while compiling: CREATE TABLE
  • different behavior of app when signed with production key
  • Prevent softkeyboard dismiss on the android back button press
  • can't instantiate class... no empty constructor
  • Image Quality degrading after getting bitmap from internet and setting it to a Image View
  • Home Icon is not showing next to Hamburger icon in ActionBar
  • Layout issue with Toolbar
  • Prevent my android:theme from modifying dialogs?
  • Facebook login with Parse always returns false in user.isNew() Android
  • I get NullPointerException in an Android animation?
  • Things move out of place on different screen sizes
  • android database: the method open() is undefined for the type databasehelper class
  • sending intent with a parcelable extra from widget crashes on activity startup
  • How to record a video less than 10 mb using Android
  • Android - serialize object to pass it over Bluetooth NotSerializableException
  • Facebook Login Button Android in Eclipse
  • Null pointer exception on adding a marker to google maps
  • Jackson : Can not deserialize instance of java.util.ArrayList out of VALUE_TRUE token
  • How to customize PagerTitleStrip android
  • Click event not being captured for ListView items with HorizontalScrollView
  • HAX kernel module is not installed
  • Android: signed watchface on Android Wear 5.0 not installed
  • Dialog Builder in PreferenceFragment
  • HttpClient change UserAgent
  • Numerous 'No resource found' and 'Error retrieving parent' in Android Project
  • Get call log of a particular number
  • Invalid "--android-sdk" value "C:\android-sdk-win" in Titanium while deploying app on android mobile
  • Call onResume() method from Asynctask's onPostExecute() Method
  • Linking with native SO file present in included library project of Android
  • GridView error in horizontal spacing
  • Progressbar on bottom of listview item
  • Adding Markers on Google maps v2 Android
  • How to Remove Duplicate Libraries added via gradle?
  • Datepicker Dialog Validation...!
  • Scale image in ImageView to width of the parent and scale in height accordingly
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org