'Delphi Kiosk mode template issue with C++ Builder (can find xml)
I could desperately use some help with finding out why Embarcadero's Android Kiosk Lock mode template is having issues deploying. I have C++ Builder 11.0 Alexandria, moved PAS files over and compiles and links. However, when I deploy per Embarcadero directions, I get this error.
[PAClient Error] Error: E2312 C:\Users\rodge\Documents\Embarcadero\Studio\Projects\fun\Source\Android\Debug\Kiosk\AndroidManifest.xml:69: error: Error: No resource found that matches the given name (at 'resource' with value '@xml/device_owner_receiver').
Stock Android.manifest.xml
file:
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.embarcadero.Kiosk"
android:versionCode="1"
android:versionName="1.0.0"
android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="30" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BIND_DEVICE_ADMIN" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:glEsVersion="0x00020000" android:required="True"/>
<application android:persistent="False"
android:restoreAnyVersion="False"
android:label="Kiosk"
android:debuggable="true"
android:largeHeap="False"
android:icon="@drawable/ic_launcher"
android:theme="@style/AppTheme"
android:hardwareAccelerated="true"
android:resizeableActivity="false">
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
android:label="Kiosk"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
android:launchMode="singleTask"
android:lockTaskMode="always">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="Kiosk" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm"
/>
<receiver android:name="com.kiosk.app.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver
android:name="com.kiosk.admin.AdminReceiver"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data
android:name="android.app.device_admin"
android:resource="@xml/device_owner_receiver"/>
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
<action android:name="android.app.action.PROFILE_PROVISIONING_COMPLETE"/>
</intent-filter>
</receiver>
</application>
</manifest>
<!-- END_INCLUDE(manifest) -->
The stock device_owner_reciever.xml
file contains:
<?xml version="1.0" encoding="utf-8"?>
<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
<uses-policies>
<limit-password/>
<watch-login/>
<reset-password/>
<force-lock/>
<wipe-data/>
<expire-password/>
<encrypted-storage/>
<disable-camera/>
</uses-policies>
</device-admin>
I have tried adding to resource and as a file. What am I missing here?
Solution 1:[1]
you must add the resource to the deployment
- press Project - Deployment
- select configuration (release/debug)
- press Add Files and find the file: device_owner_receiver.xml (you find it in xml folder)
the result should be:
local path = xml\
local name = device_owner_reciver.xml
remote path = res\xml
remote name = device_owner_reciver.xml
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |