Building Tutorial From "Your First Android App" Video

I just went through the tutorial for the “Your First Android App” and when I attempt to build it I get the following warnings and error:

Warning 1 The element ‘PropertyGroup’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’ has invalid child element ‘MSBuildAllProjects’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’. List of possible elements expected: 'Property, AllowUnsafeBlocks, AppConfigForCompiler, ApplicationIcon, ApplicationRevision, ApplicationVersion, AppDesignerFolder, AspNetConfiguration, AssemblyKeyContainerName, AssemblyKeyProviderName, AssemblyName, AssemblyOriginatorKeyFile, AssemblyOriginatorKeyFileType, AssemblyOriginatorKeyMode, AssemblyType, AutoGenerateBindingRedirects, AutorunEnabled, BaseAddress, BootstrapperComponentsLocation, BootstrapperComponentsUrl, BootstrapperEnabled, CharacterSet, CheckForOverflowUnderflow, CLRSupport, UseDebugLibraries, CodePage, Configuration, ConfigurationName, ConfigurationOverrideFile, CreateDesktopShortcut, CreateWebPageOnPublish, CurrentSolutionConfigurationContents, DebugSecurityZoneURL, DebugSymbols, DebugType, DefaultClientScript, DefaultHTMLPageLayout, DefaultTargetSchema, DefineConstants, DefineDebug, DefineTrace, DelaySign, DisableLangXtns, DisallowUrlActivation, CodeAnalysisAdditionalOptions, CodeAnalysisApplyLogFileXsl, CodeAnalysisConsoleXsl, CodeAnalysisCulture, CodeAnalysisFailOnMissingRule… C:\Program Files (x86)\MSBuild\RemObjects Software\Oxygene\RemObjects.Oxygene.Cooper.Android.targets 4 6 Miscellaneous Files

Warning 2 The element ‘ItemGroup’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’ has invalid child element ‘AvailableItemName’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’. List of possible elements expected: ‘Item, Reference, COMReference, COMFileReference, Xdcmake, Bscmake, ClCompile, ClInclude, Midl, ResourceCompile, PreLinkEvent, CustomBuildStep, Manifest, ProjectConfiguration, ProjectCapability, NativeReference, ProjectReference, Compile, EmbeddedResource, Content, Page, Resource, ApplicationDefinition, None, BaseApplicationManifest, Folder, Import, Service, WebReferences, WebReferenceUrl, FileAssociation, BootstrapperFile, PublishFile, PRIResource, AppxSystemBinary, AppxReservedFileName, AppxManifestFileNameQuery, AppxManifest, StoreAssociationFile, CodeAnalysisDependentAssemblyPaths, CodeAnalysisDictionary, CodeAnalysisImport, Link, ResourceCompile, PreBuildEvent, PostBuildEvent’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’. C:\Program Files (x86)\MSBuild\RemObjects Software\Oxygene\RemObjects.Oxygene.Cooper.Android.targets 15 6 Miscellaneous Files

Warning 3 The element ‘PropertyGroup’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’ has invalid child element ‘DisableDebugLaunch’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’. List of possible elements expected: 'Property, AllowUnsafeBlocks, AppConfigForCompiler, ApplicationIcon, ApplicationRevision, ApplicationVersion, AppDesignerFolder, AspNetConfiguration, AssemblyKeyContainerName, AssemblyKeyProviderName, AssemblyName, AssemblyOriginatorKeyFile, AssemblyOriginatorKeyFileType, AssemblyOriginatorKeyMode, AssemblyType, AutoGenerateBindingRedirects, AutorunEnabled, BaseAddress, BootstrapperComponentsLocation, BootstrapperComponentsUrl, BootstrapperEnabled, CharacterSet, CheckForOverflowUnderflow, CLRSupport, UseDebugLibraries, CodePage, Configuration, ConfigurationName, ConfigurationOverrideFile, CreateDesktopShortcut, CreateWebPageOnPublish, CurrentSolutionConfigurationContents, DebugSecurityZoneURL, DebugSymbols, DebugType, DefaultClientScript, DefaultHTMLPageLayout, DefaultTargetSchema, DefineConstants, DefineDebug, DefineTrace, DelaySign, DisableLangXtns, DisallowUrlActivation, CodeAnalysisAdditionalOptions, CodeAnalysisApplyLogFileXsl, CodeAnalysisConsoleXsl, CodeAnalysisCulture, CodeAnalysisFailOnMissingRule… C:\Program Files (x86)\MSBuild\RemObjects Software\Oxygene\RemObjects.Oxygene.Cooper.Android.targets 21 6 Miscellaneous Files

Warning 4 The element ‘Target’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’ has invalid child element ‘ResolveAndroidReferences’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’. List of possible elements expected: 'Task, AL, AspNetCompiler, AssignCulture, AssignProjectConfiguration, AssignTargetPath, AxImp, CallTarget, CombinePath, ConvertToAbsolutePath, Copy, CreateCSharpManifestResourceName, CreateItem, CreateProperty, CreateVisualBasicManifestResourceName, Csc, Delete, Error, Exec, FindAppConfigFile, FindInList, FindUnderPath, FormatUrl, FormatVersion, GenerateApplicationManifest, GenerateBootstrapper, GenerateDeploymentManifest, GenerateResource, GenerateTrustInfo, GetAssemblyIdentity, GetFrameworkPath, GetFrameworkSdkPath, GetReferenceAssemblyPaths, LC, MakeDir, Message, Move, MSBuild, ReadLinesFromFile, RegisterAssembly, RemoveDir, RemoveDuplicates, RequiresFramework35SP1Assembly, ResolveAssemblyReference, ResolveComReference, ResolveKeySource, ResolveManifestFiles, ResolveNativeReference, ResolveNonMSBuildProjectOutput, SGen, SignFile, TlbImp, Touch, UnregisterAssembly, UpdateManifest, Vbc, VCBuild, Warning, WriteCodeFragment, WriteLinesToFile, XslTransformation, CodeAnalysis, CL, Link, BSCMake, CPPClean, Get… C:\Program Files (x86)\MSBuild\RemObjects Software\Oxygene\RemObjects.Oxygene.Cooper.Android.targets 37 6 Miscellaneous Files

Warning 5 The element ‘PropertyGroup’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’ has invalid child element ‘BuildDependsOn’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’. List of possible elements expected: 'Property, AllowUnsafeBlocks, AppConfigForCompiler, ApplicationIcon, ApplicationRevision, ApplicationVersion, AppDesignerFolder, AspNetConfiguration, AssemblyKeyContainerName, AssemblyKeyProviderName, AssemblyName, AssemblyOriginatorKeyFile, AssemblyOriginatorKeyFileType, AssemblyOriginatorKeyMode, AssemblyType, AutoGenerateBindingRedirects, AutorunEnabled, BaseAddress, BootstrapperComponentsLocation, BootstrapperComponentsUrl, BootstrapperEnabled, CharacterSet, CheckForOverflowUnderflow, CLRSupport, UseDebugLibraries, CodePage, Configuration, ConfigurationName, ConfigurationOverrideFile, CreateDesktopShortcut, CreateWebPageOnPublish, CurrentSolutionConfigurationContents, DebugSecurityZoneURL, DebugSymbols, DebugType, DefaultClientScript, DefaultHTMLPageLayout, DefaultTargetSchema, DefineConstants, DefineDebug, DefineTrace, DelaySign, DisableLangXtns, DisallowUrlActivation, CodeAnalysisAdditionalOptions, CodeAnalysisApplyLogFileXsl, CodeAnalysisConsoleXsl, CodeAnalysisCulture, CodeAnalysisFailOnMissingRule… C:\Program Files (x86)\MSBuild\RemObjects Software\Oxygene\RemObjects.Oxygene.Cooper.Android.targets 50 6 Miscellaneous Files

Warning 6 The element ‘Target’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’ has invalid child element ‘GenerateAndroidResources’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’. List of possible elements expected: 'Task, AL, AspNetCompiler, AssignCulture, AssignProjectConfiguration, AssignTargetPath, AxImp, CallTarget, CombinePath, ConvertToAbsolutePath, Copy, CreateCSharpManifestResourceName, CreateItem, CreateProperty, CreateVisualBasicManifestResourceName, Csc, Delete, Error, Exec, FindAppConfigFile, FindInList, FindUnderPath, FormatUrl, FormatVersion, GenerateApplicationManifest, GenerateBootstrapper, GenerateDeploymentManifest, GenerateResource, GenerateTrustInfo, GetAssemblyIdentity, GetFrameworkPath, GetFrameworkSdkPath, GetReferenceAssemblyPaths, LC, MakeDir, Message, Move, MSBuild, ReadLinesFromFile, RegisterAssembly, RemoveDir, RemoveDuplicates, RequiresFramework35SP1Assembly, ResolveAssemblyReference, ResolveComReference, ResolveKeySource, ResolveManifestFiles, ResolveNativeReference, ResolveNonMSBuildProjectOutput, SGen, SignFile, TlbImp, Touch, UnregisterAssembly, UpdateManifest, Vbc, VCBuild, Warning, WriteCodeFragment, WriteLinesToFile, XslTransformation, CodeAnalysis, CL, Link, BSCMake, CPPClean, Get… C:\Program Files (x86)\MSBuild\RemObjects Software\Oxygene\RemObjects.Oxygene.Cooper.Android.targets 62 6 Miscellaneous Files

Warning 7 The element ‘Target’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’ has invalid child element ‘DownCaseFilename’ in namespace ‘http://schemas.microsoft.com/developer/msbuild/2003’. List of possible elements expected: 'Task, AL, AspNetCompiler, AssignCulture, AssignProjectConfiguration, AssignTargetPath, AxImp, CallTarget, CombinePath, ConvertToAbsolutePath, Copy, CreateCSharpManifestResourceName, CreateItem, CreateProperty, CreateVisualBasicManifestResourceName, Csc, Delete, Error, Exec, FindAppConfigFile, FindInList, FindUnderPath, FormatUrl, FormatVersion, GenerateApplicationManifest, GenerateBootstrapper, GenerateDeploymentManifest, GenerateResource, GenerateTrustInfo, GetAssemblyIdentity, GetFrameworkPath, GetFrameworkSdkPath, GetReferenceAssemblyPaths, LC, MakeDir, Message, Move, MSBuild, ReadLinesFromFile, RegisterAssembly, RemoveDir, RemoveDuplicates, RequiresFramework35SP1Assembly, ResolveAssemblyReference, ResolveComReference, ResolveKeySource, ResolveManifestFiles, ResolveNativeReference, ResolveNonMSBuildProjectOutput, SGen, SignFile, TlbImp, Touch, UnregisterAssembly, UpdateManifest, Vbc, VCBuild, Warning, WriteCodeFragment, WriteLinesToFile, XslTransformation, CodeAnalysis, CL, Link, BSCMake, CPPClean, Get… C:\Program Files (x86)\MSBuild\RemObjects Software\Oxygene\RemObjects.Oxygene.Cooper.Android.targets 84 6 Miscellaneous Files

Error 8 (GR5) Error while running Android tool: aapt.exe C:\Program Files (x86)\MSBuild\RemObjects Software\Oxygene\RemObjects.Oxygene.Cooper.Android.targets 62 5 com.remobjects.firstapp

Can anyone help me understand why the app won’t compile? This does not appear to be typo in the code I edited.

the first warnings are because you have a .targets file open, VS does this and unfortunately it doesn’t know not to show those. Just close that file and they’ll disapear.

This is the real error. Can you go to Tools/Options/Projects & Solutions/Build, then set both MSBuild log levels to “Detailed” and compile again? The output panel should have more information on why it fails. Before you do that though, can you make sure to open the Android SDK ‘SDK Manager’ and make sure you have:

  • Android SDK Tools
  • Android Platform-Tools
  • At least 1 Android sdk

Closing the file removed the warnings. When I went through your list, I did have everything installed, but noticed that version 21.0.2 of the SDK Build-tools was available. I had 21.0.1. So I installed that. Then recompiled and was told I have a typo in my code. When creating the intent in MainActivity.cs, I misspelled typeof as typof. It seems odd to me that after correcting that typo I got the same aapt.exe error again when I recompiled, but also was told there was a timeout on loading the emulator. So I started the virtual device emulator, waited for it to fully load, then attempted to recompile again and it worked.

Should I, in general, start the emulator and wait for it to fully load before attempting to compile? My laptop shouldn’t be too slow. Its a i7 with 8gb ram (lenovo y410p).

The typo error is clear to me, but this aapt.exe issue is still a mystery and I’d like to understand the build process enough to know the tool I am trying out. That way I can better understand how to use RemObjects. The tools look great and I’m excited about the possibility of using one language for apps on multiple platforms.

It kind of depends on what the AAPT error is (you can see it in the Output panel when changing the build settings as above). Compiling doesn’t actually talk to the emulator, only running does (pressing f5/play) and yes, sometimes if the emulator takes too long to start it will timeout, then you can just wait till it’s started and retry.

If you want to make android debugging faster (the emulator is REALLY slow), have a look at Making Android debugging faster