Skip to content

Android 11: queries in Manifest prevent app from building, if package name has "-" or "_" #5004

@inikityuk

Description

@inikityuk

Steps to Reproduce

  1. Add "queries" tag into AndroidManifest.xml
  2. Add two packages into "queries" tag with "-"(hyphen) and "_"(underscore)

<queries>
<package android:name="com.company.namewith-hyphen" />
<package android:name="com.company.namewith_undescore" />
</queries>

  1. Build

This is Xamarin Android template app with updated AndroidManifest.xml file to replicate issue (just build)
Android11QueryIssue.zip

Expected Behavior

According to https://developer.android.com/studio/build/application-id "_"(underscore) is valid symbol, so expectation is ability to build the app without any problems.

"-"(hyphen) is not recommended, but still valid if you going to create packageID for new project, also historically it wasn't enforced, so some apps have it as well.

Actual Behavior

Build fail and complain about package name

Version Information

=== Visual Studio Community 2019 for Mac ===

Version 8.7.1 (build 15)
Installation UUID: 69445bf9-eca9-46ce-a7b7-d8dc63705483
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000090

=== Mono Framework MDK ===

Runtime:
Mono 6.12.0.90 (2020-02/d3daacdaa80) (64-bit)
Package version: 612000090

=== Roslyn (Language Service) ===

3.7.0-6.20371.12+917b9dfae12e3b6cb266a3c062fb20a1e9d5fb06

=== NuGet ===

Version: 5.7.0.6702

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.302/Sdks
SDK Version: 3.1.302
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.6
2.1.20

=== Xamarin.Profiler ===

Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 11.6 (16141)
Build 11E708

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin.Android ===

Version: 11.0.0.3 (Visual Studio Community)
Commit: xamarin-android/d16-7/aca845b
Android SDK: /Users/inikityuk/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 29.0.3

Build Information:
Mono: 83105ba
Java.Interop: xamarin/java.interop/d16-7@1f3388a
ProGuard: Guardsquare/proguard@ebe9000
SQLite: xamarin/sqlite@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@017078f

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/inikityuk/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.7.0.13
Hash: 8380518
Branch: remotes/origin/dev/jmt/d16-7readconfig~2
Build date: 2020-07-23 22:38:02 UTC

=== Android Device Manager ===

Version: 16.7.0.18
Hash: 4b44bc1
Branch: remotes/origin/d16-7
Build date: 2020-07-23 22:38:26 UTC

=== Xamarin Designer ===

Version: 16.7.0.492
Hash: f5afe667d
Branch: remotes/origin/d16-7-vsmac
Build date: 2020-07-10 18:42:54 UTC

=== Xamarin.iOS ===

Version: 13.20.2.2 (Visual Studio Community)
Hash: 817b6f72a
Branch: d16-7
Build date: 2020-07-18 18:45:00-0400

=== Build Information ===

Release ID: 807010015
Git revision: b2b8f289ffca8f28c585e9137d193c92462cbf14
Build date: 2020-08-07 10:38:31-04
Build branch: release-8.7
Xamarin extensions: b2b8f289ffca8f28c585e9137d193c92462cbf14

=== Operating System ===

Mac OS X 10.15.6
Darwin 19.6.0 Darwin Kernel Version 19.6.0
Sun Jul 5 00:43:10 PDT 2020
root:xnu-6153.141.1~9/RELEASE_X86_64 x86_64

Log File

Android11QueriesIssue_Build.log

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.possibly-staleIssues that are potentially no longer relevant.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions