Skip to content

CLI 8.2.x does not respect the targetSdk from AndroidManifest.xml #5664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
lambourn opened this issue Apr 25, 2022 · 0 comments
Open
3 tasks done

CLI 8.2.x does not respect the targetSdk from AndroidManifest.xml #5664

lambourn opened this issue Apr 25, 2022 · 0 comments
Labels
bug-pending-triage Reported bug, pending triage to confirm.

Comments

@lambourn
Copy link

lambourn commented Apr 25, 2022

Issue Description

After we upgraded to {N} 8.2.2 we found that during build, the CLI sets the targetSdk to 31 instead of respecting the value in App_Resources/Android/src/main/AndroidManifest.xml which was in our case set to 30.

The merged, final manifest in the APK has targetSdk 31

This is read from platforms/android/gradle.properties, defined as NS_DEFAULT_COMPILE_SDK_VERSION=31, applied in the platforms/android/app/build.gradle file through

def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk : NS_DEFAULT_COMPILE_SDK_VERSION as int }

Workaround: specify targetSdk in the config/android/resources/gradle.properties, e.g.

targetSdk = 30

Reproduction

in App_Resources/Android/src/main/AndroidManifest.xml set

<uses-sdk
    android:minSdkVersion="26"
    android:targetSdkVersion="30"/>

run ns build android

check platforms/android/app/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt or check the generated APK and it's embedded AndroidManifest.

Relevant log output (if applicable)

from `platforms/android/app/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt` 


7    <uses-sdk
7-->/me/dev/test/platforms/android/app/src/main/AndroidManifest.xml:13:5-15:44
8        android:minSdkVersion="26"
8-->/me/dev/test/platforms/android/app/src/main/AndroidManifest.xml:14:13-39
9        android:targetSdkVersion="31" />
9-->/me/dev/test/platforms/android/app/src/main/AndroidManifest.xml:15:13-42

Environment

No response

Please accept these terms

@lambourn lambourn added the bug-pending-triage Reported bug, pending triage to confirm. label Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-pending-triage Reported bug, pending triage to confirm.
Projects
None yet
Development

No branches or pull requests

1 participant