Android Question adb Error -- targetSdkVersion="34" (SOLVED)

iCAB

Well-Known Member
Licensed User
Longtime User
Hi All,

I am trying to update the target SDK to 34, but I am getting the following error during installation


Installation Error:
adb: failed to install AppName.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl632860166.tmp/base.apk (at Binary XML file line #53): com.appname.com.main: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]

Manifest:
AddManifestText(
<uses-sdk android:minSdkVersion="14" 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:theme, "@android:style/Theme.Holo")
SetApplicationAttribute(android:allowBackup, "false")
'SetApplicationAttribute(android:theme, "@style/MyTheme")
'End of default text.


'**********REQUIRED FOR QCode, also corresponding RunTime permission should be requested
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)

'********** GPS Permission ****************************
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission("android.permission.READ_PHONE_STATE")


'********** Camera Permission section ****************************
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="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.flash" android:required="false" />)

AddPermission("android.permission.CAMERA")
AddPermission("android.permission.FLASHLIGHT")
AddPermission("android.hardware.camera")


'********************************************************************************
'This section was added for FileProvider
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" />
)

'********************************************************************************
'******************* For USB permissions
AddApplicationText(
<activity android:name="main" >
    <intent-filter>
        <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
    </intent-filter>
  
    <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" android:resource="@xml/device_filter" />
</activity>
)
CreateResource(xml, device_filter.xml,
<resources>
<usb-device vendor-id="1027" product-id="24577"/>
</resources>
)



#if USE_GOOGLE_PLAY_SERVICE
'************ 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) ************
#end if

Thanks in advance!
 

iCAB

Well-Known Member
Licensed User
Longtime User
The problem was related to this part of the Manifest file
Problematic code:
<activity android:name="main">

Ok Code:
 <activity android:name="main" android:exported="true">
 
Upvote 0
Top