Dart can't find injector when using Proguard
See original GitHub issueAfter enabling minifyEnabled
for release build, crashes start occurring.
I have a proguard-rules:
-dontwarn com.f2prateek.dart.internal.**
-keep class **$$ExtraInjector { *; }
-keepclasseswithmembernames class * {
@com.f2prateek.dart.* <fields>;
}
and seeing in log:
02-08 22:03:31.765 11321-11440/? D/Dart: Looking up extra injector for pl.srw.service.AService
02-08 22:03:31.767 11321-11440/? D/Dart: Not found. Trying superclass pl.srw.service.a
02-08 22:03:31.768 11321-11440/? D/Dart: Not found. Trying superclass android.app.IntentService
02-08 22:03:31.768 11321-11440/? D/Dart: MISS: Reached framework class. Abandoning search.
I’m on version 1.1.0
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
Dart 2.0 can't find ExtraInjector with Proguard minify enabled
Dart 2.0.3 couldn't find the ExtraInjector for any of my Activities when I had proguard turned on with minifyEnabled true.
Read more >Can't find proguard-rules.pro in my flutter app - Stack Overflow
First, we will enable shrinking in the build file. Find build.gradle file which sits inside /android/app/ folder and add lines in bold
Read more >Q&A: Steel Tanks - Hart and Iliff
This quarter our Questions & Answers segment discusses issues regarding steel oil tanks. Are steel tanks still used for oil tank installations?
Read more >Special Order Products! - Trucks Muscle & Trucks
Pro-Guard D2 oil filters are the next generation in oil filter technology. ... Fuel Heaters; Fuel Injection Control Modules; Fuel Injector Adapters ...
Read more >Deconstructing Kony Android Applications - Black Hat
encrypt the source code. • I'm not sure when they did this, changelogs on the site seem to be sparse or I can't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bmarty you are right, I changed it and it works. Here you can find the sources and PR: https://github.com/f2prateek/dart/pull/163
@stephanenicolas let me know any problems
Hi, I see that after removing the last field with @Bind from my fragment, the fragment class is now obfuscated.
So I conclude that the proguard rule:
does not work and
works.
The diff between @Bind and @InjectExtra is that the first has CLASS retention and the second has SOURCE retention.
=> It is just an idea, but maybe @InjectExtra should have CLASS retention to fix this issue
Benoît