Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6836753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:23:38+00:00 2026-05-26T23:23:38+00:00

i try obfuscate my code of android app with ProGuard . But after this

  • 0

i try obfuscate my code of android app with ProGuard. But after this my app give exception at running:

11-15 01:46:26.818: W/System.err(21810): java.lang.RuntimeException: Missing type parameter.
11-15 01:46:26.828: W/System.err(21810):    at da.<init>(Unknown Source)
11-15 01:46:26.828: W/System.err(21810):    at gc.<init>(Unknown Source)
11-15 01:46:26.828: W/System.err(21810):    at fx.f(Unknown Source)
11-15 01:46:26.828: W/System.err(21810):    at com.yourshows.activity.UnwatchedActivity.onResume(Unknown Source)

I checked a mapping file and found this:

com.google.gson.reflect.TypeToken -> da:

I think it’s lines in my app like:

        Type mapType = new TypeToken<Map<Integer, WatchedEpisodes>>(){}.getType(); // define generic type
        jsData = gson.fromJson(r, mapType);

I can not understand what conclusions should I do? Do not use variable name less then three characters or what?

UPD: answer

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:23:38+00:00Added an answer on May 26, 2026 at 11:23 pm

    answer is: use this proguard.cfg

    ##---------------Begin: proguard configuration common for all Android apps ----------
    -optimizationpasses 5
    -dontusemixedcaseclassnames
    -dontskipnonpubliclibraryclasses
    -dontskipnonpubliclibraryclassmembers
    -dontpreverify
    -verbose
    -dump class_files.txt 
    -printseeds seeds.txt 
    -printusage unused.txt 
    -printmapping mapping.txt 
    -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
    
    
    -allowaccessmodification
    -keepattributes *Annotation*
    -renamesourcefileattribute SourceFile
    -keepattributes SourceFile,LineNumberTable
    -repackageclasses ''
    
    
    -keep public class * extends android.app.Activity
    -keep public class * extends android.app.Application
    -keep public class * extends android.app.Service
    -keep public class * extends android.content.BroadcastReceiver
    -keep public class * extends android.content.ContentProvider
    -keep public class * extends android.app.backup.BackupAgentHelper
    -keep public class * extends android.preference.Preference
    -keep public class com.android.vending.licensing.ILicensingService
    -dontnote com.android.vending.licensing.ILicensingService
    
    
    # Explicitly preserve all serialization members. The Serializable interface
    # is only a marker interface, so it wouldn't save them.
    -keepclassmembers class * implements java.io.Serializable {
        static final long serialVersionUID;
        private static final java.io.ObjectStreamField[] serialPersistentFields;
        private void writeObject(java.io.ObjectOutputStream);
        private void readObject(java.io.ObjectInputStream);
        java.lang.Object writeReplace();
        java.lang.Object readResolve();
    }
    
    
    # Preserve all native method names and the names of their classes.
    -keepclasseswithmembernames class * {
        native <methods>;
    }
    
    
    -keepclasseswithmembernames class * {
        public <init>(android.content.Context, android.util.AttributeSet);
    }
    
    
    -keepclasseswithmembernames class * {
        public <init>(android.content.Context, android.util.AttributeSet, int);
    }
    
    
    # Preserve static fields of inner classes of R classes that might be accessed
    # through introspection.
    -keepclassmembers class **.R$* {
      public static <fields>;
    }
    
    
    # Preserve the special static methods that are required in all enumeration classes.
    -keepclassmembers enum * {
        public static **[] values();
        public static ** valueOf(java.lang.String);
    }
    
    
    -keep public class * {
        public protected *;
    }
    
    
    -keep class * implements android.os.Parcelable {
      public static final android.os.Parcelable$Creator *;
    }
    ##---------------End: proguard configuration common for all Android apps ----------
    
    
    ##---------------Begin: proguard configuration for Gson  ----------
    # Gson uses generic type information stored in a class file when working with fields. Proguard
    # removes such information by default, so configure it to keep all of it.
    -keepattributes Signature
    
    
    # Gson specific classes
    -keep class sun.misc.Unsafe { *; }
    #-keep class com.google.gson.stream.** { *; }
    
    
    # Application classes that will be serialized/deserialized over Gson
    -keep class com.google.gson.examples.android.model.** { *; }
    
    
    ##---------------End: proguard configuration for Gson  ----------
    

    Big thanks to owner this project –> google-gson


    UPD:
    google/gson has their example of proguard configuration for android applications.

    see on github

    They propose to use this template of configuration

    ##---------------Begin: proguard configuration for Gson  ----------
    # Gson uses generic type information stored in a class file when working with fields. Proguard
    # removes such information by default, so configure it to keep all of it.
    -keepattributes Signature
    
    # For using GSON @Expose annotation
    -keepattributes *Annotation*
    
    # Gson specific classes
    -keep class sun.misc.Unsafe { *; }
    #-keep class com.google.gson.stream.** { *; }
    
    # Application classes that will be serialized/deserialized over Gson
    -keep class com.google.gson.examples.android.model.** { *; }
    
    ##---------------End: proguard configuration for Gson  ----------
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to obfuscate my project, but not all code. I try obfuscate only
Try running this in a .VBS file MsgBox(545.14-544.94) You get a neat little answer
Try this: Make a new XCode4 Applescript project. In the delegate, paste this code:
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
Try the following code public enum Color { Blue=1, Red=2, Green=3 } public List<Color>
try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); System.out.println(Enter the continent;); String CN =
Try pasting =10**-2 into a cell in MS Excel. After pressing Enter, it turns
Try this: <div style=float:left><p>LEFT</p></div> <div style=float:right><p>RIGHT</p></div> <div><p> <input type=text style=width:100% /> <input type=submit />
Try the following sample code: <div style=background-color:#ddd> <div style=width:900px; margin:0px auto> <div class=row> <div
Try this showcase: <!doctype html> <html> <head> <style> html { min-height: 100%; overflow-y: scroll;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.