子傲 2019-08-08 16:14 采纳率: 0%
浏览 1923

Android 编译报 the <provider> element must be a direct child of the <application>element

报错提示AndroidManifest.xml:28: error: unexpected element found in .

附上代码

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.allerror.cameraalbumtest">
           <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">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <provider
                android:name="android.support.v4.content,FileProvider"
                android:authorities="com.allerror.cameraalbumtest.fileprovider"
                android:exported="false"
                android:grantUriPermissions="true">
                <meta-date
                    android:name="android.support.FILE_PROVIDER_PATHS"
                    android:resource="@xml/file_paths"/>
            </provider>
        </activity>
    </application>

</manifest>
  • 写回答

2条回答 默认 最新

  • 夏小森 2019-08-08 17:26
    关注

    你的provider标签应该放在application标签里,不应该放在activity的标签里

    评论

报告相同问题?

悬赏问题

  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题