Hello All,
I get the following error, while installing in Android 14 with SdkVersion = 34
I have read that we now have to declare the foregroundServiceType.
I read the google notes, but I confess that I am a bit lost here.
For instance, in my Manifest shown below, I need to add that in all of the AddPermission("android.permission.... declarations?
Only in the AddManifestText(<uses-permission ... ?
Can someone give me an example of the correct way to do it, please.
Thanks in advance
I get the following error, while installing in Android 14 with SdkVersion = 34
Log Error:
java.lang.RuntimeException: Unable to start service xevolution.vrcg.v2900.demo.comms@6afd28c with Intent { cmp=xevolution.vrcg.v2900.demo/.comms }: java.lang.RuntimeException: android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{2b7e237 15445:xevolution.vrcg.v2900.demo/u0a740} targetSDK=34
I have read that we now have to declare the foregroundServiceType.
I read the google notes, but I confess that I am a bit lost here.
For instance, in my Manifest shown below, I need to add that in all of the AddPermission("android.permission.... declarations?
Only in the AddManifestText(<uses-permission ... ?
Manifest Text:
'This code will be applied to the manifest file during compilation.
AddManifestText(<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="34"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:largeHeap,"true")
SetApplicationAttribute(android:usesCleartextTraffic, "true")
AddManifestText(<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="34" />)
AddManifestText(<uses-permission android:name="android.permission.INTERNET" />)
AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.flash" android:required="false" />)
AddPermission("android.permission.WAKE_LOCK")
AddPermission("android.permission.DEVICE_POWER")
AddPermission(android.permission.MANAGE_EXTERNAL_STORAGE)
AddPermission(android.permission.SEND_SMS)
AddPermission(android.permission.INSTALL_PACKAGES)
AddPermission("android.permission.READ_PHONE_STATE")
AddPermission("android.permission.VIBRATE")
AddPermission("android.permission.CAMERA")
AddPermission("android.permission.FLASHLIGHT")
AddPermission("android.hardware.camera")
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-path name="root" path="" />)
AddManifestText(<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />)
AddManifestText(<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />)
'************ Google Play Services Base ************
AddApplicationText(
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="false"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
)
'************ Google Play Services Base (end) ************
AddApplicationText(<meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode,,face" />)
AddPermission(android.permission.ACCESS_BACKGROUND_LOCATION)
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.ACCESS_WIFI_STATE)
AddPermission(android.permission.CHANGE_WIFI_STATE)
AddPermission(android.permission.SCHEDULE_EXACT_ALARM)
AddPermission(android.permission.BLUETOOTH_ADVERTISE)
AddPermission(android.permission.BLUETOOTH_CONNECT)
AddPermission(android.permission.BLUETOOTH_SCAN)
AddPermission(android.permission.INTERNET)
AddApplicationText(<uses-library android:name="org.apache.http.legacy" android:required="false" />)
AddApplicationText(<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyD80wHumtgPImuxF_7Zk_aluqxAYsrtCOo"/>)
AddManifestText(<queries> <package android:name="com.google.android.apps.maps" /> </queries>)
AddManifestText(<queries> <intent> <action android:name="android.intent.action.VIEW" /> <data android:mimeType="application/pdf" /> </intent> </queries>)
AddManifestText(<queries> <intent> <action android:name="android.intent.action.VIEW" /> <data android:mimeType="application/vnd.ms-excel" /> </intent> </queries>)
AddManifestText(<queries> <intent> <action android:name="android.intent.action.VIEW" /> <data android:mimeType="application/msword" /> </intent> </queries>)
Can someone give me an example of the correct way to do it, please.
Thanks in advance