question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dart can't find injector when using Proguard

See original GitHub issue

After 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:open
  • Created 7 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
luckpizzacommented, Oct 4, 2017

@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

0reactions
bmartycommented, Apr 5, 2017

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:

-keepclasseswithmembernames class * {
    @com.f2prateek.dart.* <fields>;
}

does not work and

-keepclasseswithmembernames class * {
    @butterknife.* <fields>;
}

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found