Android can not find android.support.v4.content.FileProvider unresolved package 'content' when calling the camera

Tip unresolved package 'content' is added provider of the application AndroidManifest.xml

<provider
	<!--
		下一行代码报错 
		unresolved package 'content'
	-->
	android:name="android.support.v4.content.FileProvider"
	android:authorities="com.wocus.wine.fileprovider"
	android:exported="false"
	android:grantUriPermissions="true">
	<meta-data
		android:name="android.support.FILE_PROVIDER_PATHS"
		android:resource="@xml/filepaths" />
</provider>

Query document shows that the latest Android standard will android.support.v4.content.FileProviderreplace in order androidx.core.content.FileProvider
to change it to

<provider
	android:name="androidx.core.content.FileProvider"
	android:authorities="com.wocus.wine.fileprovider"
	android:exported="false"
	android:grantUriPermissions="true">
	<meta-data
		android:name="android.support.FILE_PROVIDER_PATHS"
		android:resource="@xml/filepaths" />
</provider>
Published 208 original articles · won praise 841 · Views 1.21 million +

Guess you like

Origin blog.csdn.net/baishuiniyaonulia/article/details/104082850