Failed to find provider info for

后端 未结 2 410
太阳男子
太阳男子 2021-01-12 16:20

I have read just about everything there is to find here on this issue, not getting past this.

I have a simple app starting with the MainActivity, my

相关标签:
2条回答
  • 2021-01-12 16:53
    <provider android:authorities="de.somename.provider"
        android:enabled="true"
        android:multiprocess="true"
        android:name=".hvkContentProvider"
        android:exported="true" ></provider>
    

    From reference page on <provider>: Link

    android:authorities: ......To avoid conflicts, authority names should use a Java-style naming convention (such as com.example.provider.cartoonprovider). Typically, it's the name of the ContentProvider subclass that implements the provider.

    In your case, android:authorities should have the value: de.somename.provider.hvkContentProvider.


    android:name:...... The name of the class that implements the content provider, a subclass of ContentProvider. This should be a fully qualified class name (such as, "com.example.project.TransportationProvider"). However, as a shorthand, if the first character of the name is a period, it is appended to the package name specified in the element.

    So, if you are defining package in the manifest tag of AndroidManifest.xml, make sure hvkContentProvider is in that package. Else, change android:name=".hvkContentProvider" to android:name="de.somename.hvk3.hvkContentProvider" or your.package.name.hvkContentProvider

    0 讨论(0)
  • 2021-01-12 16:56

    Try using fully qualified path in android:authorities thereby replacing de.somename.provider with de.somename.provider.hvkContentProvider in so that it becomes as follows.

    <provider android:authorities="de.somename.provider.hvkContentProvider"
                  android:enabled="true"
                  android:multiprocess="true"
                  android:name=".hvkContentProvider"
                  android:exported="true" ></provider>
    

    You can refer this

    0 讨论(0)
提交回复
热议问题