Skip to content

[Xamarin.Android.Build.Tasks] Seeing new AAPT0000 errors when building certain projects against master - #275

Merged
jonpryor merged 1 commit into
dotnet:masterfrom
dellis1972:Bug45137
Oct 21, 2016
Merged

jonpryor merged 1 commit into
dotnet:masterfrom
dellis1972:Bug45137

Conversation

@dellis1972

Copy link
Copy Markdown
Contributor

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=45137

This is a weird bug. When building from the commandline using
xbuild/msbuild or from VS the system behaves as it should do.
But when building from XS it seems the DesignTimeBuild value
is being reset to ''. This results in the required target
GetAdditionalResourcesFromAssemblies from being run when it should,
which results in the following errors

error APT0000: No resource identifier found for attribute 'foo.foo'

This commit is part of another one which will be included in the
monodroid repo. It alters the condition of for the GetAdditionalResourcesFromAssemblies
target to let it run when $(DesignTimeBuild) is 'false' or ''.
Which means it will not run when the IDE's pass $(DesignTimeBuild) = 'true'
(which they currently do).

…g certain projects against master

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=45137

This is a weird bug. When building from the commandline using
xbuild/msbuild or from VS the system behaves as it should do.
But when building from XS it seems the DesignTimeBuild value
is being reset to ''. This results in the required target
GetAdditionalResourcesFromAssemblies from being run when it should,
which results in the following errors

	error APT0000: No resource identifier found for attribute 'foo.foo'

This commit is part of another one which will be included in the
monodroid repo. It alters the condition of for the GetAdditionalResourcesFromAssemblies
target to let it run when $(DesignTimeBuild) is 'false' or ''.
Which means it will not run when the IDE's pass $(DesignTimeBuild) = 'true'
(which they currently do).
@dellis1972 dellis1972 added the do-not-merge PR should not be merged. label Oct 21, 2016
@jonpryor

Copy link
Copy Markdown
Contributor

Why shouldn't this be merged?

@dellis1972 dellis1972 removed the do-not-merge PR should not be merged. label Oct 21, 2016
@dellis1972

Copy link
Copy Markdown
Contributor Author

@jonpryor I was just double checking something and didn't want this merged too early. Its ready now

@jonpryor
jonpryor merged commit 0ca2c21 into dotnet:master Oct 21, 2016
radical pushed a commit that referenced this pull request May 8, 2018
…275)

Context: https://github.com/xamarin/xamarin-android/projects/1

Updated the generator to generate helper marshaling methods for
classes implementing `Java.Interop.IJavaPeerable` interface and their
methods with `Android.Runtime.RegisterAttribute` custom attribute.
Plus `__RegisterNativeMembers()` method to register these methods
during runtime.

The `JniRuntime.JniMarshalMemberBuilder.cs` change is a workaround
for a Mono BCL bug, which causes this exception:

	Error: jnimarshalmethod-gen: Unable to process assembly '…/obj/Debug/android/assets/Mono.Android.dll'
	Index was outside the bounds of the array.
	System.IndexOutOfRangeException: Index was outside the bounds of the array.
	  at System.Attribute.InternalParamGetCustomAttributes (System.Reflection.ParameterInfo parameter, System.Type attributeType, System.Boolean inherit) [0x0005b] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/attribute.cs:60
	  at System.Attribute.GetCustomAttributes (System.Reflection.ParameterInfo element, System.Type attributeType, System.Boolean inherit) [0x0008b] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/attribute.cs:681
	  at System.Attribute.GetCustomAttribute (System.Reflection.ParameterInfo element, System.Type attributeType, System.Boolean inherit) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/attribute.cs:749
	  at System.Attribute.GetCustomAttribute (System.Reflection.ParameterInfo element, System.Type attributeType) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/attribute.cs:742
	  at System.Reflection.CustomAttributeExtensions.GetCustomAttribute (System.Reflection.ParameterInfo element, System.Type attributeType) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/reflection/CustomAttributeExtensions.cs:22
	  at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T] (System.Reflection.ParameterInfo element) [0x00000] in <e36d106f4822473d8910305e5d059e11>:0
	  at Java.Interop.JniRuntime+JniMarshalMemberBuilder.GetParameterMarshaler (System.Reflection.ParameterInfo parameter) [0x0001f] in …/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniRuntime.JniMarshalMemberBuilder.cs:138
	  at Java.Interop.MarshalMemberBuilder.CreateMarshalToManagedExpression (System.Reflection.MethodInfo method, Java.Interop.JavaCallableAttribute callable, System.Type type) [0x002f1] in …/xamarin-android/external/Java.Interop/src/Java.Interop.Export/Java.Interop/MarshalMemberBuilder.cs:182
	  at Java.Interop.MarshalMemberBuilder.CreateMarshalToManagedExpression (System.Reflection.MethodInfo method) [0x00014] in …/git/clean-full/xamarin-android/external/Java.Interop/src/Java.Interop.Export/Java.Interop/MarshalMemberBuilder.cs:32
	  at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.CreateMarshalMethodAssembly (System.String path) [0x00272] in …/xamarin-android/external/Java.Interop/tools/jnimarshalmethod-gen/App.cs:183
	  at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.Main (System.String[] args) [0x001a5] in …/xamarin-android/external/Java.Interop/tools/jnimarshalmethod-gen/App.cs:67
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants