FileProvider crash - npe attempting to invoke XmlResourceParser on a null String

前端 未结 9 1879
误落风尘
误落风尘 2020-11-28 21:38

This is a part of my manifest:




        
9条回答
  •  庸人自扰
    2020-11-28 21:58

    In my case, I got the error because the

    BuildConfig.APPLICATION_ID
    

    was being imported from

    import android.support.v4.BuildConfig;
    

    So the string it returned was "android.support.v4" instead of my project package name. Check out the import file is from your import project.Buildconfig and not another. Example:

    import com.example.yourProjectName.BuildConfig;
    

    Finally, in tag in Manifest I have android:authorities="${applicationId}" to always get my project package name as the authority

    
       ..
       ..
       
        ..
        ..
           
                
            
    
        
    
    
    

提交回复
热议问题