Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] How to exclude package name and sub package name while using progaurd In Android Studio?

Posted on November 14, 2022

Solution 1 :

The correct rule for keeping everything in package in.myapplication.app.samplePackage and all subpackages is:

-keep class in.myapplication.app.samplePackage.** {*;}

The warning you see could be a false negative, see issue 153616200.

Solution 2 :

On Android Studio 4.0 and above double asterisks ()** won’t compile anymore. So if you want to fix this error and exclude sub-packages do it like this

-keep class in.myapplication.app.samplePackage.*.* {*;}

this will exclude the packages inside samplePackage as well

Problem :

I have my project package name as

in.myapplication.app

and I have a package which contains several packages as well like this

in.myapplication.app.samplePackage

in.myapplication.app.samplePackage.SubPackage

Now I want to exclude all the classes present inside samplePackage package including subpackage classes also. I tried this keep rule inside progaurd file

-keep class  in.myapplication.app.samplePackage.*{*;}

But it only allows the classes that are in samplePackage and not in samplePackage.SubPackage

I have checked similar questions

  1. How to keep/exclude a particular package path when using proguard?
  2. Make Proguard completely ignore package

Nothing working and tried to use these

-keep class in.myapplication.app.samplePackage.** {*;}

But it’s showing me a warning

Unresolved reference name in shrinker config file

So, How to exclude package name and sub package name while using progaurd In Android Studio?

Comments

Comment posted by Style-7

This works for me -keep class in.myapplication.app.samplePackage.** { *; }

Comment posted by AgentP

@Style-7 which android version are you using? I am using android studio 4.0 I presume that it exists on 4.0 and above

Comment posted by stackoverflow.com/a/4904402/9365212

See Daniel’s comment on this answer

Comment posted by issue 153616200

The issue in Android Studio 4.0 is in the IDE which wrongly flags the

READ  [ANSWERED] java - Android Studio Drag and Drop Multiple Objects Simultaneously
Powered by Inline Related Posts

Comment posted by AgentP

@sgjesse So it’s the IDE problem then?

Comment posted by sgjesse

Yes the IDE will make a class like

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress