ActiveAndroid icon indicating copy to clipboard operation
ActiveAndroid copied to clipboard

SecurityException Content provider

Open alvaromarco opened this issue 6 years ago • 5 comments

java.lang.SecurityException: Failed to find provider null for user 0; expected to find a valid ContentProvider for this authority
        at android.os.Parcel.createException(Parcel.java:1950)
        at android.os.Parcel.readException(Parcel.java:1918)
        at android.os.Parcel.readException(Parcel.java:1868)
        at android.content.IContentService$Stub$Proxy.notifyChange(IContentService.java:812)
        at android.content.ContentResolver.notifyChange(ContentResolver.java:2112)
        at android.content.ContentResolver.notifyChange(ContentResolver.java:2063)
        at android.content.ContentResolver.notifyChange(ContentResolver.java:2033)
        at com.activeandroid.query.From.execute(From.java:304)
        at com.example.model.FeaturedGallery.saveAll(FeaturedGallery.java:136)
        at com.example.api.FeaturedGalleryJob.storeData(FeaturedGalleryJob.java:45)
        at com.example.api.ExampleJob.onRun(ExampleJob.java:109)
        at com.path.android.jobqueue.BaseJob.safeRun(BaseJob.java:108)
        at com.path.android.jobqueue.JobHolder.safeRun(JobHolder.java:60)
        at com.path.android.jobqueue.executor.JobConsumerExecutor$JobConsumer.run(JobConsumerExecutor.java:201)
        at java.lang.Thread.run(Thread.java:764)

My app works perfectly in Android < Oreo but in Android Oreo crash

My AndroidManifest.xml its right, I add the solutions in other threads about this problem

<provider
            android:name=".contentprovider.CustomProvider"
            android:enabled="true"
            android:exported="false"
            android:authorities="@string/authority"/>`

alvaromarco avatar May 08 '19 14:05 alvaromarco

@alvaromarco do you think Active Android is still supported?

naXa777 avatar May 08 '19 18:05 naXa777

@alvaromarco do you think Active Android is still supported?

No, I know but I need to try

alvaroDigio avatar May 09 '19 09:05 alvaroDigio

<provider
            android:name="com.activeandroid.content.ContentProvider"
            android:authorities="YOUR_APP_PACKAGENAME"
            android:enabled="true"
            android:exported="false">
        </provider>

We use this config in manifest, and have not encountered problems yet.

peterdk avatar Jun 12 '19 13:06 peterdk

I see the same problem on Android 13 for some of the users.

konstantin-gorbunov avatar Nov 24 '22 08:11 konstantin-gorbunov

@konstantin-gorbunov , this library was great 8 years ago. Now it's outdated and not maintained. I recommend you consider migration to alternative ORMs.

naXa777 avatar Nov 24 '22 11:11 naXa777