Android Question error: resource xml/file_paths (aka b4a.example:xml/file_paths) not found.

Isac

Active Member
Licensed User
Longtime User
hi all,


in my program I'm using this library: https://www.b4x.com/android/forum/threads/class-fileprovider-share-files.97865/#content

but I get this error:

B4A Versione: 12.20
Analisi del Codice. (0.00s)
Java Versione: 11
Building folders structure. (0.02s)
Compilazione del codice. (0.03s)
Compilazione del codice di layouts (0.00s)
Organizzazione Librerie. (0.00s)
(AndroidX SDK)
Compilazione risorse (0.10s)
Collegamento risorse Error
AndroidManifest.xml:28: error: resource xml/file_paths (aka b4a.example:xml/file_paths) not found.
error: failed processing manifest.



I don't understand where I should place the file_paths.xml file?


I inserted this inside the file:

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
</paths>


Thank you
 

DonManfred

Expert
Licensed User
Longtime User
check the configured packagename. It shoult not contain any spaces. Only a domainlike packagename.
 
Upvote 0

Isac

Active Member
Licensed User
Longtime User
I tried to change the name but it generates the same error.... com.gimmy.pippo

this is my manifest:

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="31"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>
)

SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)

'Permissions
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.READ_EXTERNAL_STORAGE)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)

'FileProvider Configuration
AddApplicationText(
<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="$PACKAGE$.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths"/>
</provider>
)
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Forum search is working well for "FileProvider". You seem to be missing a CreateResource manifest entry
 
Upvote 0
Top