Failed to compile the generated registrar code - MT4109 - xamarin.ios

Building a Xamarin.Forms application into iOS, I get the following error
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_CompileToNative target) ->
MTOUCH: error MT4109: Failed to compile the generated registrar code. Please file a bug report at http://bugzilla.xamarin.com
6 Warning(s)
1 Error(s)
Time Elapsed 00:00:51.5040280
obj/iPhone/Debug/build-iphone8.1-10.1.1/mtouch-cache/registrar.m:6806:74: error: expected a type
-(BOOL) gestureRecognizer:(UIGestureRecognizer *)p0 shouldReceivePress:(UIPress *)p1;
^
/obj/iPhone/Debug/build-iphone8.1-10.1.1/mtouch-cache/registrar.m:6848:74: error: expected a type
-(BOOL) gestureRecognizer:(UIGestureRecognizer *)p0 shouldReceivePress:(UIPress *)p1
^
obj/iPhone/Debug/build-iphone8.1-10.1.1/mtouch-cache/registrar.m:6851:10: error: no matching function for call to 'native_to_managed_trampoline_37'
return native_to_managed_trampoline_37 (self, _cmd, &managed_method, p0, p1, "UIKit.UIGestureRecognizer, Xamarin.iOS", "UIKit.UIPress, Xamarin.iOS", "UIKit.UIGestureRecognizer+_UIGestureRecognizerDelegate, Xamarin.iOS", "ShouldReceivePress");
obj/iPhone/Debug/build-iphone8.1-10.1.1/mtouch-cache/registrar.m:1705:13: note: candidate function not viable: no known conversion from 'id' to 'int *' for 5th argument
static BOOL native_to_managed_trampoline_37 (id self, SEL _cmd, MonoMethod **managed_method_ptr, UIGestureRecognizer * p0, UIPress * p1, const char *r0, const char *r1, const char *r2, const char *r3)
^
4 errors generated.
Which only happens when trying to deploy to a physical device, on simulator everything works great.

I got the same issue with vs 2017 in Virtual Machine in the Mac. It's came because of the auto updating of Xcode 11.0, Xamarin.ios version of the vs 2017 not compatible with the Xcode 11.0,
First I updated vs 2017--> vs 2019 and visual studio for Mac also updated to latest version, after that the issue was gone😀

I got the same error today. I had XCode 7.0.1 before, looks like the UIPress class is introduced after iOS 9.2 which doesn't come with XCode 7.0.1. So I just upgraded my XCode, which fixed the problem.

Related

QEMU PIPE error in Android Studio Bumblebee

I'm trying to implement a function that updates the textview every 30 ms as it repeats a division multiple times. However, the emulator's screen is stuck at showing 60 (the numerator) instead of the quotient.
** the 4 lines of error codes**
E/wifi_forwarder: qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:wififorward' service: Invalid argument
E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
E/netmgr: qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:network' service: Invalid argument
E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
Here are some methods I've tried but didn't work and the above error codes kept repeating itself
updating the CMAKE and NDK of the SDK manager
lowering the min SDK from 19 to 17
adding android:usesCleartextTraffic="true" in the manifest in application
mainactivity.kt
mainactivity.kt-screenshot
manifest.xml
androidmanifest-screen

Unknown argument type '__attribute__' in method RCTAppState. Extend RCTConvert to support this type

Got the following error running a react-native app on iOS:
Xcode 11 Error: "Unknown argument type '__attribute__' in method -[RCTAppState getCurrentAppState:error:]. Extend RCTConvert to support this type."
Solution taken from here:
This is a 0.59 version bug.
Edit the following file:
react-native/React/Base/RCTModuleMethod.mm
Add in line 94:
RCTReadString(input, "__attribute__((__unused__))") ||

Connecting Sparkfun ESP8266 Thing to Azure IoT Hub

I am currently trying to connect my Sparkfun ESP8266 Thing to my Azure IoT Hub. I have successfully set up my hub, and am following this tutorial on how to connect the Thing to my Azure IoT Hub: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-sparkfun-esp8266-thing-dev-get-started
Unfortunately I keep getting the error:
'StaticJsonBuffer' was not declared in this scope
Arduino: 1.8.5 (Windows 10), Board: "SparkFun ESP8266 Thing, 80 MHz, 512K (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
Build options changed, rebuilding all
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino: In function 'bool readMessage(int, char*)':
message:46: error: 'StaticJsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:46:5: note: suggested alternative:
In file included from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/StaticJsonDocument.hpp:8:0,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.hpp:10,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.h:9,
from C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:2:
C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note: 'ArduinoJson::Internals::StaticJsonBuffer'
class StaticJsonBuffer : public Internals::StaticJsonBufferBase {
^
message:46: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
message:74: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
root.printTo(payload, MESSAGE_MAX_LEN);
^
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino: In function 'void parseTwinMessage(char*)':
message:80: error: 'StaticJsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:80:5: note: suggested alternative:
In file included from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/StaticJsonDocument.hpp:8:0,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.hpp:10,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.h:9,
from C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:2:
C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note: 'ArduinoJson::Internals::StaticJsonBuffer'
class StaticJsonBuffer : public Internals::StaticJsonBufferBase {
^
message:80: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
message:82: error: 'class ArduinoJson::JsonObject' has no member named 'success'
if (!root.success())
^
message:88: error: 'ArduinoJson::Internals::enable_if >::type' has no member named 'success'
if (root["desired"]["interval"].success())
^
exit status 1
'StaticJsonBuffer' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I have changed the DEVICE_ID from "SparkFun ESP8266 Thing Dev" to "SparkFun ESP8266 Thing", and am using simulated data.
Any help with this would be much appreciated!
The reason for this error is that you install the ArduinoJson version >= 6. Default version 6.2.3-beta will be installed but from version 6 and higher JsonBuffer is replaced with JsonDocument. It is also indicate in the error message:
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:46:5:
note: suggested alternative:
In file included from
C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/StaticJsonDocument.hpp:8:0
To solve this issue you can roll back to the previous version. Version 5.13.2 works for me.
Reference issue on ArduinoJson repo and issue on iot-hub-feather-huzzah-client-app repo.

Install OpenCV-2.4.9 on CentOS 7 (PC)

I'm trying to install OpenCV-2.4.9 on CentOS 7 (PC) however getting error after 16% when running "make" command. I leave default configuration for OpenCV.
make
...
[ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_v4l.cpp.o /opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:306:29: error: field ‘capability’ has incomplete type
struct video_capability capability;
^ /opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:307:29: error: field ‘captureWindow’ has incomplete type
struct video_window captureWindow;
....
....
/opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp: In function ‘void icvCloseCAM_V4L(CvCaptureCAM_V4L*)’:
/opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:2812:46: error: ‘CvCaptureCAM_V4L’ has no member named ‘memoryBuffer’
It seems that the define HAVE_CAMV4L has the value 1, if you look in the file modules/highgui/src/cap_v4l.cpp looking for the structure definition at the row 306. If the compilation fails at that point this means that the video4linux development configuration is corrupted.
Using google I have found that the OpenCV Bug #1357 is described as follow:
CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L) succeeds even though linux/videodev.h doesn't exist on the system. (Bug #1357)
http://code.opencv.org/issues/1357
Anyway the solution is described at the same URL for "HAVE_CAMV4L gets set incorrectly": "Setting it to FALSE in CMakeLists.txt fixes the problem".

Use of static_assert forbidden in Android project

I am porting some C++ code to Android. One of the source files includes a webrtc header file that causes error during compilation. I have reduced the problem to this simple code:
template <class T, int n>
struct DefaultDeleter<T[n]> {
// Never allow someone to declare something like scoped_ptr<int[10]>.
static_assert(sizeof(T) == -1, "do not use array with size as type");
};
The error I get is:
[armeabi-v7a] Compile++ thumb: dummyclient <= dummy.cpp
dummy.cpp:7:3: warning: identifier 'static_assert' will become a keyword in C++0x [-Wc++0x-compat]
dummy.cpp:5:8: error: 'DefaultDeleter' is not a template
dummy.cpp:7:17: error: expected identifier before 'sizeof'
dummy.cpp:7:17: error: expected ',' or '...' before 'sizeof'
dummy.cpp:7:70: error: ISO C++ forbids declaration of 'static_assert' with no type [-fpermissive]
The same code compiles fine on Windows and Linux. Is there some compiler settings that are required for Android? Regards.
You need to pass the CPPFLAG -std=c++11.

Resources