AndroidMAnifest文件提供程序存在问题

时间:2019-06-28 16:46:44

标签: xml android-manifest android-contentprovider

我正在尝试构建相机应用程序,该程序可以拍摄照片并将其存储在本地。每当我将提供程序添加到我的AndroidManifest.xml文件中时,我都会在“会话'应用程序:安装失败。安装失败”中得到运行错误提示

我尝试将android:exported =“ false”更改为android:exported =“ true”。没用。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.eservis">

    <uses-permission
        android:name="android.permission.CAMERA" />
    <uses-feature
        android:name="android.hardware.Camera"
        android:required="true" />
    <uses-feature
        android:name="android.hardware.camera.autofocus" />

    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="EServis v2.0"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.Design.Light.NoActionBar"
        tools:ignore="GoogleAppIndexingWarning">
        <activity
            android:name=".OtvorenNalogActivity"
            android:label="@string/title_activity_otvoren_nalog"
            android:parentActivityName=".NaloziActivity"
            android:theme="@style/Theme.Design.Light" />
        <activity
            android:name=".NaloziActivity"
            android:label=""
            android:parentActivityName=".MainActivity"
            android:theme="@style/Theme.Design.Light">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name=".LogInActivity"
            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="com.example.android.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_path" />
        </provider>


        <meta-data
            android:name="android.app.searchable"
            android:resource="@xml/searchable" />
    </application>

</manifest>```

I expect to be able to save my photos to local storage.

0 个答案:

没有答案