This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 46931 - 'Error: no package specified' message with
Summary: 'Error: no package specified' message with
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: 7.0 (C8)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 15.2
Assignee: dean.ellis
Depends on:
Reported: 2016-11-14 16:18 UTC by Randy
Modified: 2017-03-21 20:23 UTC (History)
3 users (show)

See Also:
Tags: XATriaged
Is this bug a regression?: ---
Last known good build:

diagnostic level build log (66.86 KB, application/zip)
2016-11-14 18:03 UTC, Randy
Pixel log (19.19 KB, application/zip)
2016-11-14 18:50 UTC, Randy
Nexus log (20.44 KB, application/zip)
2016-11-14 18:50 UTC, Randy

Description Randy 2016-11-14 16:18:38 UTC
After upgrading to, when I build my project i get a WARNING with the text "Error: no package specified". This only happens if I have my android device attached to the mac. The device is a Google Pixel C tablet. This is just a warning and the build actually happened and can be used.

Checking the diagnostic level build log, I see the following:
	Target _GetPrimaryCpuAbi:
	Task "GetPrimaryCpuAbi"
		Using task GetPrimaryCpuAbi from Xamarin.Android.Tasks.GetPrimaryCpuAbi, Xamarin.Android.Build.Debugging.Tasks, Version=, Culture=neutral, PublicKeyToken=null
		Adb Task:
		  ToolPath: /Users/Randy/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/
		  ToolExe: adb
		  OnMultipleTargetsDetected: ignore
		Tool /Users/Randy/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb execution started with arguments: devices 
		Environment variables being passed to the tool:
		Tool /Users/Randy/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb execution finished.
		  FoundDevices: True
		Tool /Users/Randy/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb execution started with arguments: shell getprop 
		Environment variables being passed to the tool:
		Tool /Users/Randy/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb execution finished.
		Tool /Users/Randy/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb execution started with arguments: shell getprop ro.product.cpu.abilist64 
		Environment variables being passed to the tool:
		Tool /Users/Randy/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb execution finished.
		Tool /Users/Randy/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb execution started with arguments: shell pm dump  
		Environment variables being passed to the tool:
		Tool /Users/Randy/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb execution finished.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets:  warning : Error: no package specified

		  SdkVersion: 24
	Done executing task "GetPrimaryCpuAbi"
	Task "CreateProperty"
		Using task CreateProperty from Microsoft.Build.Tasks.CreateProperty, Microsoft.Build.Tasks.Core, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
	Done executing task "CreateProperty"
	Task "Message"
		Using task Message from Microsoft.Build.Tasks.Message, Microsoft.Build.Tasks.Core, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
	Done executing task "Message"
	Done building target "_GetPrimaryCpuAbi" in project "/Users/Randy/Documents/Rome/Client/Android/Splitware.csproj".

The problem is in the 'adb shell pm dump' command being sent to the device. The adb command is what is generating the text "Error: no package specified". If no device is attached, the first "adb devices" command says there are no devices and the failing command isn't run.

One odd issue I noted here is that a previous command to read the abi (adb shell getprop ro.product.cpu.abilist64) says it is arm64-v8a. I don't have that in my list of abi's to support in the build options, just armeabi and armeabi-v7a. I can't use arm64-v8a since I use a library that doesn't support arm64-v8a yet. I don't know if this is part of the problem or unrelated.
Comment 1 dean.ellis 2016-11-14 16:59:27 UTC
looks like $(_AndroidPackage) is blank? It should not be. That value is retrieved from the AndroidManifest.xml.

Is this error in an app project or a library project?
Comment 2 Randy 2016-11-14 18:03:06 UTC
This is an app project that is compiling with 2 binding projects that have already built. I'll attach the full build log but the package name should be set to com.mobilereach.splitware. Both the project file and the manifest file have it set and the log shows it is set.
Comment 3 Randy 2016-11-14 18:03:33 UTC
Created attachment 18456 [details]
diagnostic level build log
Comment 4 Randy 2016-11-14 18:39:45 UTC
A new empty android app project also gets the same error
Comment 5 Randy 2016-11-14 18:50:06 UTC
I tried a build with a new test project while the pixel C tablet was attached and again while a nexus 5 was attached. The nexus doesn't get the error. I'm attaching both build logs. It looks like the build process doesn't like the pixel's abi value of arm64-v8a and is getting confused. The nexus log doesn't issue the 'shell pm dump' command that fails but issues 'shell getprop ro.product.cpu.abi' instead at that point.
Comment 6 Randy 2016-11-14 18:50:24 UTC
Created attachment 18457 [details]
Pixel log
Comment 7 Randy 2016-11-14 18:50:37 UTC
Created attachment 18458 [details]
Nexus log
Comment 8 René Astad Dupont 2016-11-28 07:26:30 UTC
Hav you found solution for this.

I get the same warning with on my Xperia z4 tablet. I don't se the warning, with my Xperia Z3 compact, or with the emulator.
Comment 9 dean.ellis 2016-11-28 10:11:33 UTC
Look like the GetPrimaryCpuAbi is being called too early. It needs to be called after the "_ValidateAndroidPackageProperties" target.
Comment 10 dean.ellis 2016-11-28 10:24:32 UTC
if you want to try to work around this locally edit Xamarin.Android.Common.Debugging.targets. 

Look for the Name="_GetPrimaryCpuAbi" target and replace




Hopefully that will fix the issue.
Comment 11 René Astad Dupont 2016-11-28 21:51:46 UTC
Probably the suggested work around is not relevant for me, as I don't find the "DependsOnTargets line at all in my version of the file: 

<Target Name="_GetPrimaryCpuAbi">
		<Output TaskParameter="ResultingAbi" PropertyName="_PrimaryCpuAbi" />
		<Output TaskParameter="SdkVersion" PropertyName="_DeviceSdkVersion" />
			Condition="$(_PrimaryCpuAbi) == ''"
		<Output TaskParameter="Value" PropertyName="_PrimaryCpuAbi" />
	<Message Text="_PrimaryCpuAbi=$(_PrimaryCpuAbi)" />
Comment 12 René Astad Dupont 2016-11-28 22:06:33 UTC
An additional comment: In release mode I get the following error. I think it might be related as it to is related to the file ""
I have seen that this is a known error in other treads, without finding usefull solution. This error is independent of device, and is therefore serious.

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Runtime.Serialization.XsdDataContractExporter' (defined in 'System.Net.Http.Formatting, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35') from 'System.Net.Http.Formatting, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Runtime.Serialization.XsdDataContractExporter
   ved Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
   ved MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
   ved Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
   ved Mono.Linker.Steps.MarkStep.InitializeFields(TypeDefinition type)
   ved Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
   ved Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
   ved Mono.Linker.Steps.MarkStep.Initialize()
   ved Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   ved Mono.Linker.Pipeline.Process(LinkContext context)
   ved MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
   ved Xamarin.Android.Tasks.LinkAssemblies.Execute()
   --- Slutten på sporingen av intern unntaksstakk ---
   ved Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
   ved Xamarin.Android.Tasks.LinkAssemblies.Execute()
   ved Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   ved Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() (MSB4018) (Maaleravlesning)
Comment 13 dean.ellis 2016-12-01 13:33:22 UTC
Fixed in monodroid/master/a05f161a

Xamarin-Android fix

@Rene for the other Linker issue can you raise a new bug so we can assign it to the right person and keep track of the information.

Note You need to log in before you can comment on or make changes to this bug.