i got an error in MIT App Inventor, how do i fix it? - error-handling

error:
Runtime Error
Attempt to invoke virtual method 'int android.hardware.usb.UsbDeviceCo nnection.bulkTransfer(android.hardw are.usb.UsbEndpoint, byte[], int, int)' on a null object reference
End Application
i tried to make an app that talks to an arduino trough Serial

Related

objective-c: Expanded from macro

in Mopub-SDK for iOS.there is an error in calling "mp_safe_block" method.
Macro definition:
// Macros for dispatching asynchronously to the main queue
#define mp_safe_block(block, ...) block ? block(__VA_ARGS__) : nil
Called as:
mp_safe_block(complete, NSError.sdkInitializationInProgress, nil);
Error message:
Left operand to ? is void, but right operand is of type 'nullptr_t'
maybe this error has nothing to do with the SDK itself. how to fix it ?
PS:
that sdk code run correctly in a new xCode project created by myself. but there is an error in a Xcode-project builded by MMF2(clickTeam fusion)
and this xCode-project version is too old. I updateded setting of Xcode.but it still an error.

Flutter Fails on Run (or upgrade, or anything else).

I have been getting a massive error recently, upon Running any of my flutter applications in Intellij, Visual Studio, etc. I cannot perform git functions because of it either. Any help would be greatly appreciated.
(Some parts omitted - this snippet represents the 40k line code pattern)
Launching lib/main.dart on iPhone X in debug mode...
compiler message:
file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/widgets/editable_text.dart:439:9: Error: Type 'LayerLink' not found.
compiler message: final LayerLink _layerLink = new LayerLink();
compiler message: ^
compiler message: file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/rendering/proxy_box.dart:4474:20: Error: The method 'getLastTransform' isn't defined for the class 'invalid-type'.
compiler message: Try correcting the name to the name of an existing method, or defining a method named 'getLastTransform'.
compiler message: return _layer?.getLastTransform() ?? new Matrix4.identity();
compiler message: ^
compiler message: file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/rendering/proxy_box.dart:4501:18: Error: Method not found: 'FollowerLayer'.
compiler message: _layer = new FollowerLayer(
compiler message: ^^^^^^^^^^^^^
compiler message: file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/rendering/texture.dart:76:7: Error: No named parameter with the name 'rect'.
compiler message: rect: new Rect.fromLTWH(offset.dx, offset.dy, size.width, size.height),
compiler message: ^^^^
compiler message: file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/rendering/view.dart:124:11: Error: 'ContainerLayer' isn't a type.
compiler message: final ContainerLayer rootLayer = TransformLayer(transform: _rootTransform);
compiler message: ^^^^^^^^^^^^^^
compiler message: file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/rendering/view.dart:124:38: Error: Method not found: 'TransformLayer'.
compiler message: final ContainerLayer rootLayer = TransformLayer(transform: _rootTransform);
compiler message: ^^^^^^^^^^^^^^
compiler message: file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/rendering/view.dart:124:38: Error: The method 'TransformLayer' isn't defined for the class '#lib1::RenderView'.
compiler message: Try correcting the name to the name of an existing method, or defining a method named 'TransformLayer'.
compiler message: final ContainerLayer rootLayer = TransformLayer(transform: _rootTransform);
compiler message: ^
compiler message: file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/rendering/view.dart:125:15: Error: The method 'attach' isn't defined for the class 'invalid-type'.
compiler message: Try correcting the name to the name of an existing method, or defining a method named 'attach'.
compiler message: rootLayer.attach(this);
compiler message: ^
compiler message: file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/rendering/view.dart:195:13: Error: The method 'addToScene' isn't defined for the class 'invalid-type'.
compiler message: Try correcting the name to the name of an existing method, or defining a method named 'addToScene'.
compiler message: layer.addToScene(builder, Offset.zero);
compiler message: ^
compiler message: file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/rendering/view.dart:215:58: Error: The method 'find' isn't defined for the class 'invalid-type'.
compiler message: Try correcting the name to the name of an existing method, or defining a method named 'find'.
compiler message: final SystemUiOverlayStyle upperOverlayStyle = layer.find<SystemUiOverlayStyle>(top);
compiler message: ^
compiler message: file:///Users/JohnnySmithh/Documents/flutter/packages/flutter/lib/src/rendering/view.dart:220:35: Error: The method 'find' isn't defined for the class 'invalid-type'.
compiler message: Try correcting the name to the name of an existing method, or defining a method named 'find'.
compiler message: lowerOverlayStyle = layer.find<SystemUiOverlayStyle>(bottom);
compiler message: ^
Compiler failed on /Users/JohnnySmithh/IdeaProjects/MyCoolProject/lib/main.dart
Error launching application on iPhone X.
Exited (sigterm)
It's honestly a little hard to tell what's going on from just that error message. Do any errors show up in intellij before you build?
The only things I can think of are:
your flutter installation might be corrupted. You could try deleting and re-installing
your build directory might have something wrong. Try running flutter clean before building again
your libraries aren't being included properly. I'd assume this would show up in intellij, but maybe the paths are set differently there? Check Project Structure -> Libraries and see where the paths are set there.
(related to first) you might have multiple instances of flutter on your computer. If intellij is using one while the command line is using another that could potentially cause problems.
If your app happens to be open-source, or you're able to make a new app with the minimum amount of changes to reproduce the error, that would help significantly with diagnosing the problem =).

Is there a way to use boost threads and asio in native-client?

I'm trying to port some existing code that uses boost into native-client.
I compiled boost according to the instructions here: https://code.google.com/p/naclports/wiki/InstallingSDL (with boost instead of sdl), and tried injecting some boost code into one of the examples.
I was successfully able to use a boost::shared_ptr by editing examples/api/socket/socket.cc by including the header and adding a simple test method:
#include <boost/shared_ptr.hpp>
The test method:
void ExampleInstance::test_shared_ptr() {
boost::shared_ptr<std::string> test_ptr(new std::string("hi"));
PostMessage(test_ptr->c_str());
}
Invoking this method from the constructor results in a "hi" appearing on the console when loading the page you can reach by running "make serve".
Although I'm deeply impressed that this much works, my app uses boost::thread and boost::asio, and there I ran into trouble. In pepper_34, if I add:
#include <boost/threads.hpp>
I get these compilation errors, just by including that file:
~/nacl_sdk/pepper_34/examples/api/socket$ make
CHROME_PATH is undefined, and google-chrome not found in PATH, nor /usr/bin/google-chrome.
CXX newlib/Release/socket_x86_32.o
In file included from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/thread/thread_only.hpp:17,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/thread/thread.hpp:12,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/thread.hpp:13,
from socket.cc:25:
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/thread/pthread/thread_data.hpp: In member function 'size_t boost::thread_attributes::get_stack_size() const':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/thread/pthread/thread_data.hpp:63: error: invalid conversion from 'const pthread_attr_t*' to 'pthread_attr_t*'
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/thread/pthread/thread_data.hpp:63: error: initializing argument 1 of 'int pthread_attr_getstacksize(pthread_attr_t*, size_t*)'
make: *** [newlib/Release/socket_x86_32.o] Error 1
Likewise, if I try to include any of the basic asio elements, for instance:
#include <boost/asio/io_service.hpp>
I get these compilation errors after adding that #include line:
~/nacl_sdk/pepper_34/examples/api/socket$ make
CHROME_PATH is undefined, and google-chrome not found in PATH, nor /usr/bin/google-chrome.
CXX newlib/Release/socket_x86_32.o
In file included from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/posix_fd_set_adapter.hpp:26,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/fd_set_adapter.hpp:22,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/select_reactor.hpp:27,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/reactor.hpp:29,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/task_io_service.ipp:24,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/task_io_service.hpp:203,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/impl/io_service.hpp:71,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/io_service.hpp:767,
from socket.cc:25:
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/socket_types.hpp:283: error: 'IF_NAMESIZE' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/socket_types.hpp:304: error: 'sockaddr_un' does not name a type
In file included from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/socket_ops.hpp:326,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/select_reactor.ipp:30,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/select_reactor.hpp:212,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/reactor.hpp:29,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/task_io_service.ipp:24,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/task_io_service.hpp:203,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/impl/io_service.hpp:71,
from /home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/io_service.hpp:767,
from socket.cc:25:
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'int boost::asio::detail::socket_ops::close(boost::asio::detail::socket_type, boost::asio::detail::socket_ops::state_type&, bool, boost::system::error_code&)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:342: error: 'FIONBIO' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'bool boost::asio::detail::socket_ops::set_user_non_blocking(boost::asio::detail::socket_type, boost::asio::detail::socket_ops::state_type&, bool, boost::system::error_code&)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:384: error: 'FIONBIO' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'bool boost::asio::detail::socket_ops::set_internal_non_blocking(boost::asio::detail::socket_type, boost::asio::detail::socket_ops::state_type&, bool, boost::system::error_code&)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:437: error: 'FIONBIO' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'bool boost::asio::detail::socket_ops::sockatmark(boost::asio::detail::socket_type, boost::system::error_code&)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:617: error: '::sockatmark' has not been declared
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'size_t boost::asio::detail::socket_ops::available(boost::asio::detail::socket_type, boost::system::error_code&)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:637: error: 'FIONREAD' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'void boost::asio::detail::socket_ops::init_buf(boost::asio::detail::socket_ops::buf&, void*, size_t)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:687: error: invalid use of incomplete type 'struct iovec'
/home/jholland/nacl_sdk/pepper_34/include/newlib/sys/socket.h:304: error: forward declaration of 'struct iovec'
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:688: error: invalid use of incomplete type 'struct iovec'
/home/jholland/nacl_sdk/pepper_34/include/newlib/sys/socket.h:304: error: forward declaration of 'struct iovec'
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'void boost::asio::detail::socket_ops::init_buf(boost::asio::detail::socket_ops::buf&, const void*, size_t)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:698: error: invalid use of incomplete type 'struct iovec'
/home/jholland/nacl_sdk/pepper_34/include/newlib/sys/socket.h:304: error: forward declaration of 'struct iovec'
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:699: error: invalid use of incomplete type 'struct iovec'
/home/jholland/nacl_sdk/pepper_34/include/newlib/sys/socket.h:304: error: forward declaration of 'struct iovec'
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'int boost::asio::detail::socket_ops::ioctl(boost::asio::detail::socket_type, boost::asio::detail::socket_ops::state_type&, int, boost::asio::detail::ioctl_arg_type*, boost::system::error_code&)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:1689: error: 'FIONBIO' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'const char* boost::asio::detail::socket_ops::inet_ntop(int, const void*, char*, size_t, long unsigned int, boost::system::error_code&)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:1974: error: 'IF_NAMESIZE' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:1979: error: 'if_name' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:1979: error: 'if_indextoname' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:1981: error: 'if_name' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'int boost::asio::detail::socket_ops::inet_pton(int, const char*, void*, long unsigned int*, boost::system::error_code&)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:2209: error: 'if_nametoindex' was not declared in this scope
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp: In function 'int boost::asio::detail::socket_ops::gethostname(char*, int, boost::system::error_code&)':
/home/jholland/nacl_sdk/pepper_34/toolchain/linux_x86_newlib/i686-nacl/usr/include/boost/asio/detail/impl/socket_ops.ipp:2251: error: '::gethostname' has not been declared
make: *** [newlib/Release/socket_x86_32.o] Error 1
(Side Note: I don't think the CHROME_PATH warning at the top is causing these errors, since I get the same warning for the examples even without my edits, but the examples still work. I imagine it's because I'm building on a vm without chrome installed (or a window manager in which to run it), since I had to use linux to build boost according to the error message the boost build process gave when I tried building it on OSX. The error messages suggest this interferes with "make run_package", but otherwise the examples run properly under "make serve", and can be tested from a different machine, using chrome to access the pages. I'm writing this question while waiting for chromium-browser to install, in hopes I can confirm that theory.)
In case it matters, I'm running Ubuntu 12.04.
My questions:
Is there a previous pepper version in which somebody has successfully used boost::asio and/or boost::threads?
Has anyone encountered this problem and discovered a workaround?
Try building the glibc build of boost instead of newlib. You can do this by running:
TOOLCHAIN=glibc make boost
from the naclports directory.
It seems that the newlib build of boost doesn't support many boost libraries:
Component configuration:
- atomic : not building
- chrono : not building
- context : not building
- coroutine : not building
- date_time : building
- exception : not building
- filesystem : not building
- graph : not building
- graph_parallel : not building
- iostreams : not building
- locale : not building
- log : not building
- math : not building
- mpi : not building
- program_options : building
- python : not building
- random : not building
- regex : not building
- serialization : not building
- signals : not building
- system : not building
- test : not building
- thread : not building
- timer : not building
- wave : not building
The glibc build seems to support many more libraries:
Component configuration:
- atomic : building
- chrono : building
- context : not building
- coroutine : not building
- date_time : building
- exception : building
- filesystem : building
- graph : building
- graph_parallel : building
- iostreams : building
- locale : building
- log : building
- math : building
- mpi : not building
- program_options : building
- python : not building
- random : building
- regex : building
- serialization : building
- signals : not building
- system : building
- test : building
- thread : building
- timer : building
- wave : building

What does COM Error 80010105 mean and where to find other codes?

Is there a list of COM error codes somewhere?
Related: HRESULT: 0x80010105 (RPC_E_SERVERFAULT) question
From Standard COM Errors (at least for Microsoft Commerce Server):
The following table shows the most common standard COM errors returned
by the properties and methods of the Commerce Server objects:
Constant Value (32-bit) Description
S_OK 00000000 The standard return value used to communicate successful completion.
S_FALSE 00000001 An alternate success value, typically used to communicate successful, but non-standard completion. The precise meaning depends on the method or property in question.
E_UNEXPECTED 8000FFFF Catastrophic failure error.
E_NOTIMPL 80004001 Not implemented error.
E_OUTOFMEMORY 8007000E Out of memory error.
E_INVALIDARG 80070057 One or more arguments are not valid error.
E_NOINTERFACE 80004002 Interface not supported error.
E_POINTER 80004003 Pointer not valid error.
E_HANDLE 80070006 Handle not valid error.
E_ABORT 80004004 Operation aborted error.
E_FAIL 80004005 Unspecified error.
E_ACCESSDENIED 80070005 General access denied error.
Com Errors Search Engine
I got following information from the Windows Kits header file WinError.h:
//
// MessageId: RPC_E_SERVERFAULT
//
// MessageText:
//
// The server threw an exception.
//
#define RPC_E_SERVERFAULT _HRESULT_TYPEDEF_(0x80010105L)

Unresolved external symbol error

I am getting the following error in my VC++ COM project. What is the problem in linking the lib files here?
Error 4 error LNK2019: unresolved external symbol _BVUOpen#8 referenced in function "unsigned int __stdcall AFunc(void *)" (?AFunc##YGIPAX#Z) CBillAcceptor.obj BillAcceptorCOM
Here are the explanation of the LNK2019 error : MSDN.
Look for a problem of definition about BVUOPen symbol ! The problem si inside the method AFunc Maybe, you haven't declare it correctly or haven't link the library or haven't export the symbol...
Probably, you need to link against some external library that contains the object code for the BVUOpen function. The name of that library is not obvious from your error message, but it should be possible to work out from the documentation you are coding from.