pardom-zz / ActiveAndroid

Active record style SQLite persistence for Android
http://www.activeandroid.com
4.7k stars 1.03k forks source link

SecurityException Content provider #563

Open alvaromarco opened 5 years ago

alvaromarco commented 5 years ago
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"/>`
naXa777 commented 5 years ago

@alvaromarco do you think Active Android is still supported?

alvaroDigio commented 5 years ago

@alvaromarco do you think Active Android is still supported?

No, I know but I need to try

peterdk commented 5 years ago
<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.

konstantin-gorbunov commented 1 year ago

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

naXa777 commented 1 year ago

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