Failed to find provider info for 'ContentProvider'

妖精的绣舞 提交于 2019-11-30 02:54:17

I was able to reproduce your problem when I moved <provider> out of the <application>...</application> tag. Eclipse didn't say anything like error or warning.

Fortunately this issue is detected by Android Lint starting from ADT 20.

andude

It worked for me only after specifying full path in Authorities tag in manifest file (see SearchableDictionary sample code in SDK).

<provider android:name=".DictionaryProvider"
       android:authorities="com.example.android.searchabledict.DictionaryProvider">

Setting the exported attribute to true in the provider tag in the manifest worked for me :

android:exported="true"

According to the documentation(http://developer.android.com/guide/topics/manifest/provider-element.html#exported), export is required only if the provider is to be available for other applications. But this is the only solution that worked for me.

The android:authorities= in the XML file is the content authority that is located in the contract class that you probably built. The content authority is added to the scheme to make the base content URI. Plain English, the reverse domain you used to make your app no caps here com.domain.sub.appName.

The android:name is the folder plus class your provider is named, do not forget the dot .folder.ProviderClassContentAuthorityIsIn.

Hope this helps :)

you have a capital letter and on the other line, one lowercase letter.

android:name= "my.package.provider.-C-ountryContentProvider" android:authorities="my.package.provider.-c-ountrycontentprovider"

it must be the same everywhere.

public static final String PROVIDER = 
     "my.package.provider.countrycontentprovider";
mposadar

Register your provider in the Android Manifest

<provider
    android:authorities="your_content_authority"
    android:name="yourProviderClass"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!