Android Question Change target API level from 4 to 29 or 30

wdegler

Active Member
Licensed User
Longtime User
I am at the point where I need to upload a new app (APK) but my attempt to do so gives the following error message:

"Your app currently targets API level 4 and must target at least API level 29 to ensure it is built on the latest APIs optimized for security and performance. Change your app's target API level to at least 29. Learn More"

I followed the "Learn More" link but remain confused. Is Android Studio required?

Can someone tell me the specific steps required to fix this problem? Help!
 

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
Open your B4A project >> go to Project menu >> click Manifest editor
You will find in line ~5 android:targetSdkVersion , change its value to 29
 
Upvote 0

wdegler

Active Member
Licensed User
Longtime User
Open your B4A project >> go to Project menu >> click Manifest editor
You will find in line ~5 android:targetSdkVersion , change its value to 29
Thank you! I changed the "4" to "29" in the manifest. I thought that was my last barrier.
After I saved the change and attempted to compile, I got the following error message:

"Installing file to device. Error
adb: failed to install AnalyzeColors.apk: Failure [INSTALL_FAILED_OLDER_SDK: Failed parse during installPackageLI: /data/app/vmdl2012587471.tmp/base.apk (at Binary XML file line #9): Requires newer sdk version #29 (current version is #28)]"

Exactly what steps are needed now? Please advise.
 
Upvote 0

wdegler

Active Member
Licensed User
Longtime User

Thank you for your response.

My manifest code is

"'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="29" />
<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.

My B4A version is 10.70.

Please advise.
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
You should have android platform sdk 28 or 29 or 30 in your development pc.
Go to B4A program >> Tools >> Configure Paths
And check what is path in Android.Jar text found.
You will see the current Android platform you are using.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
This is currently the default code in the Manifest Editor:

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="29"/>
<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)
'End of default text.
 
Upvote 0

wdegler

Active Member
Licensed User
Longtime User

You should have android platform sdk 28 or 29 or 30 in your development pc.
Go to B4A program >> Tools >> Configure Paths
And check what is path in Android.Jar text found.
You will see the current Android platform you are using.

Thank you for your help. I finally found a discrepancy between my Android.jar path and the API level in the Manifest.
I am now using API level 30 (as the path already showed) and I have successfully completed the release.
 
Upvote 0

wdegler

Active Member
Licensed User
Longtime User
You should have android platform sdk 28 or 29 or 30 in your development pc.
Go to B4A program >> Tools >> Configure Paths
And check what is path in Android.Jar text found.
You will see the current Android platform you are using.
Thank you for your help. I finally found a discrepancy between my Android.jar path and the API level in the Manifest.
I am now using API level 30 (as the path already showed) and I have successfully completed the release.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…