Android Question Google Maps

Declan

Well-Known Member
Licensed User
Longtime User
When adding a MapFragment I receive the following error on compile:

B4X:
android.content.res.Resources$NotFoundException: Unable to find resource ID #0x2711

I have added the following to the Manifest:
B4X:
<
AddApplicationText(
<uses-library
      android:name="org.apache.http.legacy"
      android:required="false" />

<meta-data
  android:name="com.google.android.geo.API_KEY"
  android:value="AIzaSyDXiXJpRSEIeAo41lWWyRLtEhHNa6hDDsw"/>
)
/>
Which is the Maps API Key.

This is the full error:
B4X:
android.content.res.Resources$NotFoundException: Unable to find resource ID #0x2711
    at android.content.res.Resources.getResourceName(Resources.java:3681)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:975)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1163)
    at android.app.BackStackRecord.run(BackStackRecord.java:793)
    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1552)
    at android.app.FragmentManagerImpl$1.run(FragmentManager.java:487)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7225)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
I have added the following to the Manifest
post your complete manifest editor content.

The snippet you posted is invalid. Not sure if it raises such error though.
 
Upvote 0

Declan

Well-Known Member
Licensed User
Longtime User
This is the complete 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="5" 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)
'SetApplicationAttribute(android:theme, "@style/LightTheme")
SetActivityAttribute(main, android:theme, @android:style/Theme.Translucent)
AddPermission(android.permission.VIBRATE)
SetActivityAttribute (Splash, android:showWhenLocked, "true")
SetActivityAttribute (Splash, android:turnScreenOn, "true")
AddPermission(android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS)
AddPermission(android.permission.CALL_PHONE)
'

'************ Required with GetSafeDirDefaultExternal ***********
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
)
'**************************************

'********************  Required for file provider *************************
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,
   <external-files-path name="name" path="shared" />
)
'***************************************************************


'End of default text.
AddApplicationText(<meta-data
    android:name="com.google.android.gms.vision.DEPENDENCIES"
    android:value="barcode,,face" />
)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
'SetServiceAttribute(Tracker, android:foregroundServiceType, "location")

AddApplicationText(
<uses-library
      android:name="org.apache.http.legacy"
      android:required="false" />

<meta-data
  android:name="com.google.android.geo.API_KEY"
  android:value="AIzaSyDmX6Ij512yLcrZyUs4IdVBi-VtFy2i9Ds"/>
)


CreateResourceFromFile(Macro, Core.NetworkClearText)
AddPermission(android.permission.SYSTEM_ALERT_WINDOW)

AddPermission(android.permission.CAMERA)

'Samsung
AddPermission("com.sec.android.provider.badge.permission.READ")
AddPermission("com.sec.android.provider.badge.permission.WRITE")
'HTC
AddPermission("com.htc.launcher.permission.READ_SETTINGS")
AddPermission("com.htc.launcher.permission.UPDATE_SHORTCUT")
'Sony
AddPermission("com.sonyericsson.home.permission.BROADCAST_BADGE")
AddPermission("com.sonymobile.home.permission.PROVIDER_INSERT_BADGE")
'Apex
AddPermission("com.anddoes.launcher.permission.UPDATE_COUNT")
'Solid
AddPermission("com.majeur.launcher.permission.UPDATE_BADGE")
'Huawei
AddPermission("com.huawei.launcher3.permission.READ_SETTINGS")
AddPermission("com.huawei.launcher3.permission.WRITE_SETTINGS")
AddPermission("com.huawei.launcher2.permission.READ_SETTINGS")
AddPermission("com.huawei.launcher2.permission.READ_SETTINGS")
AddPermission("com.huawei.android.launcher.permission.CHANGE_BADGE")
AddPermission("com.huawei.android.launcher.permission.WRITE_SETTINGS")
AddPermission("com.huawei.android.launcher.permission.READ_SETTINGS")
'Zuk
AddPermission("android.permission.READ_APP_BADGE")
'Oppo
AddPermission("com.oppo.launcher.permission.READ_SETTINGS")
AddPermission("com.oppo.launcher.permission.WRITE_SETTINGS")
'EvMe
AddPermission("me.everything.badger.permission.BADGE_COUNT_READ")
AddPermission("me.everything.badger.permission.BADGE_COUNT_WRITE")

AddPermission("com.android.launcher.permission.READ_SETTINGS")
AddPermission("com.android.launcher.permission.WRITE_SETTINGS")
AddPermission("com.android.launcher.permission.INSTALL_SHORTCUT")
AddPermission("com.android.launcher.permission.UNINSTALL_SHORTCUT")
 
Upvote 0
Top