繁体   English   中英

AndroidMAnifest文件提供程序存在问题

[英]Problem with AndroidMAnifest File provider

我正在尝试构建拍摄照片并将其存储在本地的相机应用。 每当我将提供程序添加到我的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.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM