Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

RunTimeException: Unable to create application caused by TrayContract.getAuthority #129

Open
OUCHUNYU opened this issue May 10, 2018 · 4 comments

Comments

@OUCHUNYU
Copy link

tray Version (E.g. 0.12.0)

0.12.0

Device(s) (E.g. Samsung Galaxy S8)

unknown, likely many different device manufactures and types

How have you setup tray (E.g. Initialized in Application.onCreate, in an Activity, BroadcastReceiver, IntentService, MainThread)

In my case, I use Tray in a library project. The library splits into client and service. The client part of the library is used in application main process. The service part is a remote service running in a separate process. Both client and service initialize tray AppPreferences object and do read/write operations.

Both client and server side share use Tray in the same way.
initialize it this way

private AppPreferences appPreferences = new AppPreferences(context);

and call put and get

Android Version (E.g. Marshmallow or better API 23)

Around version 4.2 to 4.4

Stacktrace

Stacktrace
Fatal Exception: java.lang.RuntimeException: Unable to create application xxxxxxxx: xxxxx: Internal tray error. Could not find the provider authority. Please fill an issue at https://github.com/grandcentrix/tray/issues
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6431)
     at android.app.ActivityThread.access$1800(ActivityThread.java:229)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:148)
     at android.app.ActivityThread.main(ActivityThread.java:7331)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by net.grandcentrix.tray.a.h: Internal tray error. Could not find the provider authority. Please fill an issue at https://github.com/grandcentrix/tray/issues
     at net.grandcentrix.tray.provider.TrayContract.getAuthority(TrayContract.java:138)
     at net.grandcentrix.tray.provider.TrayContract.generateContentUri(TrayContract.java:109)
     at net.grandcentrix.tray.provider.TrayContract.generateContentUri(TrayContract.java:80)
     at net.grandcentrix.tray.provider.TrayUri.(TrayUri.java:75)
     at net.grandcentrix.tray.provider.ContentProviderStorage.(ContentProviderStorage.java:146)
     at net.grandcentrix.tray.TrayPreferences.(TrayPreferences.java:43)
     at net.grandcentrix.tray.TrayPreferences.(TrayPreferences.java:48)
     at net.grandcentrix.tray.AppPreferences.(AppPreferences.java:41)

Description (Just a place with additional information, more == better)

@OUCHUNYU OUCHUNYU changed the title RunTimeException: Unable to create application caused by TrayContract.getAuthority RunTimeException: Unable to create application caused by TrayContract.getAuthority May 10, 2018
@passsy
Copy link
Contributor

passsy commented May 15, 2018

Are you accessing Tray in Application#onCreate?

@OUCHUNYU
Copy link
Author

@passsy Thanks for the reply. My project is a library project. Inside this library, I access Tray in the library constructor, but I don't really know how the library users construct my library, I would imagine there is a high chance that a user constructs my library in his/her Apllication#onCreate(), when this happens, we are accessing Tray directly in Apllication#onCreate().

@OUCHUNYU
Copy link
Author

@passsy Is there something I can do on my end to fix the issue?

@jr-developer200
Copy link

jr-developer200 commented Feb 4, 2020

@OUCHUNYU Could you please update the library to fix this issue? So that we can access Tray in Application#onCreate. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants