找不到android.support.v4.content.FileProvider [英] android.support.v4.content.FileProvider not found

查看:186
本文介绍了找不到android.support.v4.content.FileProvider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试升级可运行的旧应用程序以支持Android API 26,而我需要使用的一件事是android.support.v4.content.FileProvider-但找不到.

I am trying to upgrade a working old app to support Android API 26, and one of the thing I need to use is android.support.v4.content.FileProvider - but it was not found.

    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="${applicationId}.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/file_paths" />
    </provider>

由于早期的Android构建,gradle文件似乎很简单.它像添加依赖项一样简单吗?我环顾四周,有些人建议添加一个我不了解的multidex.感谢您的任何帮助,谢谢!

Due to the early Android build, the gradle file seems simple. Is it as simple as adding a dependency? I have look around and some suggested adding a multidex which I don't understand. Any help is appreciated, thank you!

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'

    defaultConfig {
        applicationId "virtualgs.spaint"
        minSdkVersion 22
        targetSdkVersion 26
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

推荐答案

添加编译'com.android.support:support-v4:26.1.0' build.gradle 文件.

这篇关于找不到android.support.v4.content.FileProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆