Comments (11)
Thanks for reporting this. It seems like this is not an issue with the sample itself but one you're encountering in your own application.
Can you please give me some more information on your Activity / Fragment / Module setup & stacktrace over at StackOverflow and link it here?
from app-bundle-samples.
We need your input to act on this issue.
This issue will be closed soon unless there is further actionable input.
from app-bundle-samples.
Hi @keyboardsurfer @georgious1 , I am also facing this when navigating back to fragment.
I have added this in activity.
override fun onResume() { super.onResume() SplitCompat.install(context) }
But I am getting crash in API response.
from app-bundle-samples.
Any Standard way to fix this ?
from app-bundle-samples.
Is there a way for you to reproduce the issue within this sample or a clone of it?
from app-bundle-samples.
Hi @keyboardsurfer, Not in this sample but in our application we are facing this after following all the steps to turn on Dynamic Delivery.
from app-bundle-samples.
I understand this. What I'm asking you is to try and reproduce the issue on the sample at hand. If it's reproducible here we can take a closer look.
from app-bundle-samples.
Okay, let me check and get back to you.
from app-bundle-samples.
@Rishabh-sx i added workaround to fix this issue.
enable SplitCompat to have immediate access for code and resources
https://developer.android.com/guide/playcore/dynamic-delivery#activity_splitcompat
BUT
- I enabled SplitCompat in my Application class, and my dynamic feature modules didnt have any activities, only fragments. But for sure i added following code to my activity(which was not part of DFModule).
override fun attachBaseContext(baseContext: Context) {
super.attachBaseContext(baseContext)
SplitCompat.installActivity(baseContext)
}
AND
2) When receive SplitInstallSessionStatus.INSTALLED
status i immediately called
SplitCompat.install(context.applicationContext)
with application context. And only after that i was able to use any code from DFModule
- Added following to Fragment from DFModule
override fun onAttach(context: Context?) {
super.onAttach(context)
SplitCompat.install(context)
Actually i think just number (2) did all the trick, and enabling SplitCompat in fragments looks like redundant, but wont create any issues.
from app-bundle-samples.
Ah, and small update here, rechecked docs. Maybe its new addition, but it describes step (2) from example above :
".. If you want to access assets or resources that exist in the newly installed module from a different installed module of your app, you must do so using the application context. The context of the component that's trying to access the resources will not yet be updated. Alternatively, you can recreate that component or install SplitCompat upon it after the dynamic feature module install. "
So having next code should be enough :
SplitInstallStateUpdatedListener { state ->
when (state.status()) {
SplitInstallSessionStatus.INSTALLED -> {
SplitCompat.install(context.applicationContext)
// CAN USE CODE FROM DFModule
}
}
}
from app-bundle-samples.
Hi @georgious1 , Thanks for sharing this information. Let me share this with my team and ask them to check if we are missing something.
from app-bundle-samples.
Related Issues (20)
- Resource Not Found error after close and relaunch the app HOT 1
- Duplicate class in play.core On Build Unity 2020 LTS
- AAssetManager cannot handle a pack nearly 2GB on 32 bit device
- Resource Not Found Exception
- Q: Instant Apps
- dynamic-feature mlkit translate
- Resource Not Found Relaunch Application on-Demand Dynamic Feature Module HOT 4
- Resources$NotFoundException HOT 4
- Sample code at app-bundle-samples/PlayAssetDelivery/NativeSample/ not generating all standalone apks HOT 1
- Play Asset Delivery Error Code does not match HOT 1
- Can PAD deliver SO?
- Security Policy violation Binary Artifacts HOT 28
- I want put all arr files to dynamic feature module, but have question
- Question: Would the install-time delivery still violate the maximum size limitation?
- GoogleAnalytics sample app build fails with "Unable to make protected void java.net.URLClassLoader.addURL(java.net.URL) accessible"
- ContentProvider in dynamic module HOT 1
- What about the assets file in the aar package?
- Dynamic feature UnsatisfiedLinkError
- Error receiving broadcast Intent
- How to customise downloading UI for on demand instant modules
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from app-bundle-samples.