Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ACRA fails when android:sharedUserId is set #656

Closed
ZimM-LostPolygon opened this issue Mar 24, 2018 · 1 comment
Closed

ACRA fails when android:sharedUserId is set #656

ZimM-LostPolygon opened this issue Mar 24, 2018 · 1 comment
Labels

Comments

@ZimM-LostPolygon
Copy link

ACRA fails to detect any components if android:sharedUserId is set. This is because in that case, Thread.currentThread().getContextClassLoader() is replaced with a dummy, and ServiceLoader fails to locate the resources. The fix is to replace all code like

ServiceLoader.load(ReportSenderFactory.class)

with

// Really any class from current context can be used instead of getClass()
ServiceLoader.load(ReportSenderFactory.class, getClass().getClassLoader()) 

Additional info:
grpc/grpc-java#1272
https://stackoverflow.com/questions/13407006/android-class-loader-may-fail-for-processes-that-host-multiple-applications

@F43nd1r
Copy link
Member

F43nd1r commented Mar 24, 2018

Thanks for pointing this out.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants