Tag Archives: AS common error

As Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.

Error: Error: Could not determine the class – path for interface com. Android. Builder. Model. The AndroidProject.
Reason: The gradle version was low when Eclipse exported the project, so the gradle configuration should be changed
Solution: Duplicate the normal project 2 configuration
1. Modify Build. gradle (gradle version number and Android {… })

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
}

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.3'
    ......
}

2, the gradle – wrapper. Properties

#Tue Dec 26 10:09:46 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

As Error:Failed to find configured root that contains /storage/emulated/0/xxx/xxx/xxx.png

occurrence scenario:

refers to a third-party package, and when its photo function is activated, it directly flashes back

java.lang.IllegalArgumentException: Failed to find configured root that contains 
/storage/emulated/0/PictureSelector/CameraImage/PictureSelector_20190704_135543.png
        at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:739)
        at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:418)
        at com.luck.picture.lib.PictureSelectorActivity.parUri(PictureSelectorActivity.java:444)
        at com.luck.picture.lib.PictureSelectorActivity.startOpenCamera(PictureSelectorActivity.java:378)
        at com.luck.picture.lib.PictureSelectorActivity.startCamera(PictureSelectorActivity.java:353)
        at com.luck.picture.lib.PictureSelectorActivity$10.onNext(PictureSelectorActivity.java:753)
        at com.luck.picture.lib.PictureSelectorActivity$10.onNext(PictureSelectorActivity.java:744)

search data found that it was related to the android system version of the mobile phone, my mobile phone is android 9.0, and I have some requirements on the management rights of the file

first step, specify a FileProvider. Declare an entry

in the androidmanifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapp">
    <application
        ...>
		 <provider
            android:name=".app.MyFileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths"
                tools:replace="android:resource" />
        </provider>
        ...
    </application>
</manifest>

second step, need in project res-> Add: provider_paths.xml

external-path specifies the directory you want to share. The name can be arbitrary but try to avoid the same as above. Path specifies the desired directory

then add the following at the bottom:

<?xml version="1.0" encoding="utf-8"?>
<paths>
.........
	<external-path
        name="picture_selector"
        path="PictureSelector/" />
</paths>