Caused by: java.lang.SecurityException: Failed to find provider null for user 0; expected to find a valid ContentProvider for this authority
at android.os.Parcel.readException(Parcel.java:2016)
at android.os.Parcel.readException(Parcel.java:1962)
at android.content.IContentService$Stub$Proxy.notifyChange(IContentService.java:871)
at android.content.ContentResolver.notifyChange(ContentResolver.java:2062)
at android.content.ContentResolver.notifyChange(ContentResolver.java:2013)
at android.content.ContentResolver.notifyChange(ContentResolver.java:1983)
at com.activeandroid.Model.save(Model.java:162)
at com.hht.openlive.utils.SqlUtils.saveUser(SqlUtils.java:24)
at com.hht.openlive.ui.MainActivity.saveUserInfo(MainActivity.java:82)
at com.hht.openlive.ui.MainActivity.onCreate(MainActivity.java:60)
at android.app.Activity.performCreate(Activity.java:7088)
at android.app.Activity.performCreate(Activity.java:7079)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
之前都是在安卓5.0测试的项目没有问题,今天运行在8.0系统的手机上,ActiveAndroid报了这么一个错误,解决方法很简单就是在清单文件中声明一个ContentProvider就行了
<provider
android:name="com.activeandroid.content.ContentProvider"
android:authorities="使用项目的报名"
android:enabled="true"
android:exported="false">
</provider>