Open Faisal-Naseer opened 2 years ago
The same problem happened to our app. But still no solution.
There are some clues:
- After call SplitCompat.install(context) at Application.attachBaseContext, the applicationContext.resource.asserts do have contain the dynamic module apk (on-demand)
- Then the WebView apk loaded, it refreshed the ResourcesImpl instance. At then, applicationContext.resource.asserts don't contain the dynamic module apk (on-demand)
- We guess that the installed dynamic module apk (on-demand) must be injected manually by calling SplitCompat.install every time the ResourcesImpl created, So after Step 2, the new ResoucesImpl instance don't contain the dynamic module apk (on-demand)
Don't know why Android team is no more interested in stability of such features... They always move to new stuff and leaving unresolved the old stuff
I have the same problem in my app, the resources of the third-party aar in the dynamic feature module cannot be found.
Our Solution: We monitor the property assert of resources(Application), and call SplitCompat.install() every time the assert changed in method getResources (Application)
When I download the on demand dynamic feature module it works fine as soon as I restart application I get the crash "Resource not found" . Heres the code that i copied from google dynamic features sample repo
I have already overridden the code in BaseActivity and App class
But its crashing when i revisit the application
The Exception thats occurring in my logs Crashlytics