android.support.v4.content.FileProvider not found

后端 未结 8 1287
终归单人心
终归单人心 2021-02-01 13:37

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.

相关标签:
8条回答
  • 2021-02-01 13:50

    I replaced it with the newer version, which is : androidx.core.content.FileProvider

    This worked for me.

    0 讨论(0)
  • 2021-02-01 13:59

    add compile 'com.android.support:support-v4:26.1.0' to build.gradle file in app module.

    0 讨论(0)
  • 2021-02-01 13:59

    Change to

    public class FileProvider extends androidx.core.content.FileProvider {
    }
    
    0 讨论(0)
  • 2021-02-01 14:02

    Using the following commands solved my issue:

    npm install jetifier --save
    npx jetify
    npx cap sync
    
    0 讨论(0)
  • 2021-02-01 14:04

    for androidx

    <provider
        android:name="androidx.core.content.FileProvider"
        android:authorities="${applicationId}.provider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths" />
    </provider>
    
    0 讨论(0)
  • 2021-02-01 14:05

    Instead of

    import android.support.v4.content.FileProvider;
    

    Try importing

    import androidx.core.content.FileProvider;
    
    0 讨论(0)
提交回复
热议问题