Gen*_* Xu 3 android google-api android-fileprovider
我正在开发一个用于谷歌服务文本检测的应用程序,并遇到使用File_PROVIDER共享文件的问题.
AndroidManifest.xml中:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="myPackageFoo">
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.android.nearby.messages.API_KEY"
android:value="@string/API_KEY" />
<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="ocr" />
<activity android:name=".MainActivity" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="myPackageFoo.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
</application>
Run Code Online (Sandbox Code Playgroud)
对于res/xml/provider_paths.xml:
<paths>
<files-path path="images/" name="myimages" />
<external-path name="download" path="download/"/>
</paths>
Run Code Online (Sandbox Code Playgroud)
但是我总是得到这个编译错误:
错误:找不到与给定名称匹配的资源(在'resource'处,值为'@ xml/provider_paths').
什么地方出了错?
小智 9
我只是在同一个问题上花了很多年.有些人提出错别字(没有拼写错误),有些人提到了其他可能性,例如错误的文件夹或修改config.xml或检查sdk版本的建议技术......对我来说缺少的是"provider_paths.xml"Build Action是设置为Content而不是AndroidResource因此它在编译期间从未被复制,因此它丢失并且从未找到...我认为这是同样的问题.
归档时间: |
|
查看次数: |
1983 次 |
最近记录: |