Italian Help su errore Manifest - FileProvider

MARCO C.

Active Member
Licensed User
Buongiorno ,
dietro consiglio di UDG , vorrei inserire dentro una mia App la possibilità di inviare una copia dell'ordine via mail. Quindi sto cercando di inserire FileProvider all'interno del mio codice.
Purtroppo il debug mi segnala questa errore

AndroidManifest.xml:29: error: Error: No resource found that matches the given name (at 'resource' with value '@xml/provider_paths').

Potete aiutarmi ad inserire il manifest originale del FileProvider
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

AddManifestText(<uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    android:maxSdkVersion="18" />
)

AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)

nel manifest del mio progetto

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

SetApplicationAttribute(android:theme, "@style/MyAppTheme")

AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)

CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">#0098FF</item>
        <item name="colorPrimaryDark">#007CF5</item>
        <item name="colorAccent">#AAAA00</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
    <style name="ToolbarMenu" parent="Base.ThemeOverlay.AppCompat.ActionBar">
        <item name="android:textColorPrimary">#fff</item>
        <item name="android:colorBackground">#0098FF</item>
    </style>
</resources>
)

mi pare di capire che dovrei integrare questo
B4X:
CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)

in questa mia sezione
B4X:
CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">#0098FF</item>
        <item name="colorPrimaryDark">#007CF5</item>
        <item name="colorAccent">#AAAA00</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
    <style name="ToolbarMenu" parent="Base.ThemeOverlay.AppCompat.ActionBar">
        <item name="android:textColorPrimary">#fff</item>
        <item name="android:colorBackground">#0098FF</item>
    </style>
</resources>
)

Grazie in anticipo
M.
 

MARCO C.

Active Member
Licensed User
Scusate ma era cosi semplice ... bastava metterli entrambi ?
non mi segnalato alcun errore !!

Ero convito che accettasse solo una dichiarazione CreateResource

B4X:
CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">#0098FF</item>
        <item name="colorPrimaryDark">#007CF5</item>
        <item name="colorAccent">#AAAA00</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
    <style name="ToolbarMenu" parent="Base.ThemeOverlay.AppCompat.ActionBar">
        <item name="android:textColorPrimary">#fff</item>
        <item name="android:colorBackground">#0098FF</item>
    </style>
</resources>
)

CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)

Oppure ho avuto cu.o .. fortuna ?
 
Last edited:
Top