-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-Process Apps Result in TRANSACTION_URI Not Being Initialized #16
Comments
Thanks! I half anticipated this would come up, by which point my use of I'm inclined to just add a note to the docs saying this project is not suitable for multi-process apps, until I can determine if there is enough demand to make this effort worthwhile. |
I am also running into this problem. I'm working on a simple SyncAdapter application, and was hoping to use Chuck for some network diagnostics. Looks like the issue is known, so I just wanted to add my name to the hat of affected users. |
I am also running into this problem. I use another process to collect my app crash report and send it to server. |
Just for feedback, I have also run into this problem. |
I am running into this problem too. I start an webview in another process for memory leak from webview. |
I, too, have run into this issue. |
Workaround: TRANSACTION_URI can be initialized through reflection when necessary
|
any solution on this? |
Any updates on this issue ? Also run into this problem while using SyncAdapter |
Hello! Any updates? |
Quick update: this project has been forked https://github.com/ChuckerTeam/chucker |
I tried integrating Chuck into my playground app for CWAC-NetSecurity. Using Chuck either as a regular or network interceptor resulted in:
This would result from
TRANSACTION_URI
beingnull
, either becauseattachInfo()
is not being called at all orUri.parse()
returningnull
.My playground app uses two processes. My launcher activity brings up a set of preferences to configure the scenario to try. It then starts another activity, running in a separate process, to actually test the scenario.
By default, your
ChuckContentProvider
goes into the default process. When I try applying Chuck in the other process,ChuckContentProvider.TRANSACTION_URI
will benull
, because the provider is a natural system-wide singleton, and that singleton is in the other process. Hence,attachInfo()
is never called in this process to initializeTRANSACTION_URI
.(this is one of the reasons why I don't recommend multiple processes for most apps...)
I could use manifest merger to shove
ChuckContentProvider
into the other process, which in theory should get past this crash. However, then I suspect that your activities will fail, as the default process will not haveTRANSACTION_URI
. I could further shove all of those into the other process using the same manifest merger approach, and perhaps get all this working. I'm not sure if that's what you want us to do.Some possible alternatives:
Use a static initializer for
TRANSACTION_URI
based off ofBuildConfig.APPLICATION_ID
, and use a static initialization block for theUriMatcher
. You'd keep theattachInfo()
as is. So, in normal single-process cases, developers could rename theChuckContentProvider
authority and you're covered. The limitation then is that multi-process apps would be required to leave the default authority alone, so the statically-initialized values are valid.Dump
ChuckContentProvider
entirely and do something else that does not requirestatic
values that might not exist in all processes.Thoughts?
Thanks!
The text was updated successfully, but these errors were encountered: