GCX-HCI / tray

a SharedPreferences replacement for Android with multiprocess support
Apache License 2.0
2.29k stars 273 forks source link

Could not find the provider authority. #106

Open tajchert opened 7 years ago

tajchert commented 7 years ago

I got this error from one of users phones (LG-D855 Android 6.0):

Fatal Exception: java.lang.RuntimeException: Unable to create application XApplication.onCreate: net.grandcentrix.tray.core.TrayRuntimeException: 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:4824)
       at android.app.ActivityThread.access$1600(ActivityThread.java:157)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1417)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5551)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Caused by net.grandcentrix.tray.core.TrayRuntimeException: 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(SourceFile:138)
       at net.grandcentrix.tray.provider.TrayContract.generateContentUri(SourceFile:109)
       at net.grandcentrix.tray.provider.TrayContract.generateContentUri(SourceFile:80)
       at net.grandcentrix.tray.provider.TrayUri.(SourceFile)
       at net.grandcentrix.tray.provider.ContentProviderStorage.(SourceFile)
       at net.grandcentrix.tray.TrayPreferences.(SourceFile)
       at net.grandcentrix.tray.TrayPreferences.(SourceFile)
       at net.grandcentrix.tray.AppPreferences.(SourceFile)
       at X$Builder.(SourceFile)
       at X.init(SourceFile:36)
       at X.onCreate(SourceFile:57)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4821)
       at android.app.ActivityThread.access$1600(ActivityThread.java:157)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1417)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5551)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
StefMa commented 7 years ago

Hey,

can you please give us a little bit more infos? How do you have setup Tray? Have you noticed the changes in 0.12.0? What call was made until it's crashed? 🤔

tajchert commented 7 years ago

Hi, sure. We are soon about to open source our SDK so will will call you on that at that point (<1-2 weeks). It was one time crash on over 20k devices so no any major issue at all.

Yes, we use 0.12.0 and no ContentProvider.

It was only "new AppPreferences(context)" from onCreate in Application.

tajchert commented 7 years ago

Ok, I checked Fabric once again: 6 users crashed with it, 6 times (all together so only once). Samsung and LG. Android 4.4.2, 6.0, 6.0.1, 4.1.2, 4.4.4

Always in "new AppPreferences(this)" in Application "onCreate()".

fillobotto commented 7 years ago

Same scenario for me. We are talking about lonely crashes but that's it

eggcaker commented 7 years ago

+1

StefMa commented 7 years ago

@fillobotto can you please show us some more information? How do you setup tray? On which devices/OS will happen the crash? 🤔

@tajchert is the SDK open source now? Would be great if we can have a look inside it...

tajchert commented 7 years ago

@StefMa - sorry not yet. I will post it here when done.

OUCHUNYU commented 6 years ago

@StefMa 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. For small portion of users I get


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)
imlk0 commented 6 years ago

I try to use Tray because I cant access the shared_prefs directory. But I faced this Exception when i use tray, So,I give up it,

and now I find a mistake in my AndroidManifest.xml

            android:exported="false"
            android:isolatedProcess="true"  //here !!!!!!!!!!!!!!!!!!!!!!!!!!!1
            android:label="@string/service_name"
            android:process=":autoupdate"
            android:permission="">

set android:isolatedProcess="true" makes my application process and the service process run in different UID (i check it by ps commend), and that cause the Permission Denied in SharedPreference.

I don't know if it is the same mistake that cause the tray to an Exception.