Skip to content

Conversation

@dellis1972
Copy link
Contributor

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

Under some conditions apps produces an error which does NOT
contain "error :". As a result our regex was not picking
up some errors and was just printing the default error of

"aapt.exe" exited with code 1

This commit updates the regex to allow for errors which do
not include "error :". And adds a unit test for the
specific test case.

…ode 1." and "The file "obj\Debug\android\bin\packaged_resources" does not exist" errors if drawable resource filename contains invalid character

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

Under some conditions apps produces an error which does NOT
contain "error <something>:". As a result our regex was not picking
up some errors and was just printing the default error of

	"aapt.exe" exited with code 1

This commit updates the regex to allow for errors which do
not include "error <something>:". And adds a unit test for the
specific test case.
@jonpryor jonpryor merged commit 7dadd00 into dotnet:master Jul 27, 2017
dellis1972 added a commit that referenced this pull request Aug 1, 2017
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=36485

Under some conditions apps produces an error which does NOT
contain "error <something>:". As a result our regex was not picking
up some errors and was just printing the default error of

	"aapt.exe" exited with code 1

This commit updates the regex to allow for errors which do
not include "error <something>:". And adds a unit test for the
specific test case.
jonpryor pushed a commit that referenced this pull request Sep 2, 2020
Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1139590
Context: dotnet/java-interop@afbc5b3

Changes: dotnet/java-interop@dcaf794...afbc5b3

  * dotnet/java-interop@afbc5b32: [C++] Get rid of compiler warnings (#703)
  * dotnet/java-interop@e295b498: [generator] Fix localization error. (#702)
  * dotnet/java-interop@5a0e37e0: [generator] Support 'managedOverride' metadata (#701)
  * dotnet/java-interop@f6c12ba3: [Xamarin.Android.Tools.Bytecode] Hide Kotlin synthetic constructors (#700)
  * dotnet/java-interop@0334f424: [generator] Hide Java.Lang.Object infrastructure (#698)
  * dotnet/java-interop@c0fcc435: [jcw-gen] Make MSBuild warning/error strings localizable. (#695)

Fixes a handful of warnings reported by GCC and clang when building
for different platforms.

`-Wshadow` warnings:

	monodroid-glue.cc:1609:8: warning: declaration shadows a static data member of 'xamarin::android::internal::MonodroidRuntime' [-Wshadow]
	void *api_dso_handle = nullptr;
	              ^
	monodroid-glue.cc:102:25: note: previous declaration is here
	void *MonodroidRuntime::api_dso_handle = nullptr;

Fix by renaming the local variable.  No functionality changes result
from this fix.

MinGW builds report:

	xa-internal-api.cc: In member function ‘virtual mono_bool xamarin::android::internal::MonoAndroidInternalCalls_Impl::monodroid_get_network_interface_up_state(const char*, mono_bool*)’:
	xa-internal-api.cc:24:86: warning: unused parameter ‘ifname’ [-Wunused-parameter]
	   24 | MonoAndroidInternalCalls_Impl::monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up)
	      |                                                                          ~~~~~~~~~~~~^~~~~~
	xa-internal-api.cc:24:105: warning: unused parameter ‘is_up’ [-Wunused-parameter]
	   24 | MonoAndroidInternalCalls_Impl::monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up)
	      |                                                                                              ~~~~~~~~~~~^~~~~
	xa-internal-api.cc: In member function ‘virtual mono_bool xamarin::android::internal::MonoAndroidInternalCalls_Impl::monodroid_get_network_interface_supports_multicast(const char*, mono_bool*)’:
	xa-internal-api.cc:34:96: warning: unused parameter ‘ifname’ [-Wunused-parameter]
	   34 | MonoAndroidInternalCalls_Impl::monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast)
	      |                                                                                    ~~~~~~~~~~~~^~~~~~
	xa-internal-api.cc:34:115: warning: unused parameter ‘supports_multicast’ [-Wunused-parameter]
	   34 | MonoAndroidInternalCalls_Impl::monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast)
	      |                                                                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
	xa-internal-api.cc: In member function ‘virtual int xamarin::android::internal::MonoAndroidInternalCalls_Impl::monodroid_get_dns_servers(void**)’:
	xa-internal-api.cc:44:66: warning: unused parameter ‘dns_servers_array’ [-Wunused-parameter]
	   44 | MonoAndroidInternalCalls_Impl::monodroid_get_dns_servers (void **dns_servers_array)
	      |                                                           ~~~~~~~^~~~~~~~~~~~~~~~~
	xa-internal-api.cc: In member function ‘virtual int xamarin::android::internal::MonoAndroidInternalCalls_Impl::monodroid_getifaddrs(_monodroid_ifaddrs**)’:
	xa-internal-api.cc:54:82: warning: unused parameter ‘ifap’ [-Wunused-parameter]
	   54 | MonoAndroidInternalCalls_Impl::monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap)
	      |                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
	xa-internal-api.cc: In member function ‘virtual void xamarin::android::internal::MonoAndroidInternalCalls_Impl::monodroid_freeifaddrs(_monodroid_ifaddrs*)’:
	xa-internal-api.cc:64:82: warning: unused parameter ‘ifa’ [-Wunused-parameter]
	   64 | MonoAndroidInternalCalls_Impl::monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa)
	      |                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~

Fix by ignoring the unused parameters only during Windows builds
by using the C++17 attribute `[[maybe_unused]]`

MinGW also reports:

	embedded-assemblies.cc: In static member function ‘static ssize_t xamarin::android::internal::EmbeddedAssemblies::do_read(int, void*, size_t)’:
	embedded-assemblies.cc:663:26: warning: conversion from ‘size_t’ {aka ‘long long unsigned int’} to ‘unsigned int’ may change value [-Wconversion]
	  663 |   ret = ::read (fd, buf, count);
	      |

It is caused by **read**(2) declared in MinGW headers with the third
parameter using an `unsigned int` type instead of the standard
`size_t`.  Fixed by casting properly on Windows builds.
@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