Monotouch mtouch arguments problems - xamarin.ios

Having trouble getting these two arguments to play nice when compiling a project. Any help would be much appreciated.
-gcc_flags "-L${ProjectDir} -lflite -all_load" -nosymbolstrip -nostrip -cxx -gcc_flags " -lgcc_eh -L${ProjectDir} -ltestflight -ObjC"
flite is a native C library, while TestFlight is a Obj-C library. Any idea how to make them play nice together?
The lflite library was working great, then I went to add TestFlight and things went sideways. The solution compiles but crashes on start up with:
Sep 30 15:40:18 Dev-iPhone UIKitApplication:com.cognitopia.scando[0x2e64][3288] <Notice>: Native stacktrace:
Sep 30 15:40:18 Dev-iPhone UIKitApplication:com.cognitopia.scando[0x2e64][3288] <Notice>: 0 ScanDo 0x005f9770 mono_handle_native_sigsegv + 412
Sep 30 15:40:18 Dev-iPhone UIKitApplication:com.cognitopia.scando[0x2e64][3288] <Notice>: 1 ScanDo 0x005c9788 mono_sigsegv_signal_handler + 360
Sep 30 15:40:18 Dev-iPhone UIKitApplication:com.cognitopia.scando[0x2e64][3288] <Notice>: 2 libsystem_c.dylib 0x34f3172f _sigtramp + 42
Sep 30 15:40:18 Dev-iPhone UIKitApplication:com.cognitopia.scando[0x2e64][3288] <Notice>: 3 ScanDo 0x005c93f0 mono_jit_runtime_invoke + 2800

Try:
-gcc_flags "-force_load ${ProjectDir}/libflite.a -lgcc_eh -force_load ${ProjectDir}/libtestflight.a -ObjC" -nosymbolstrip -nostrip -cxx

Merge both arguments and use --force_load since it apply only to the provided library, instead of --load_all which affects all libraries (and could play tricks with libgcc_eh.a or libtestflight.a). That would give something like:
-nosymbolstrip -nostrip -cxx -gcc_flags "-L${ProjectDir} -lflite -force_load ${ProjectDir}/libflite.a -lgcc_eh -ltestflight -ObjC"
Also it's been reported that using the testflight SDK requires using the LLVM compiler option.

Related

LSOpenURLsWithRole() failed with error -10810 for the file /Users/gb/myapp/dist/MyApplication.app

Environment:
Python 3.8
Pyqt5
Mac OS X Catalina 10.15.6
I am trying to compile my python program in Mac OS application. I get this error message when I open the app:
(base) gb#MacBookGB % open dist/MyApplication.app
LSOpenURLsWithRole() failed with error -10810 for the file /Users/gb/myapp/dist/MyApplication.app.
I checked that files can be executed:
ld -la dist/
drwxr-xr-x# 4 gb staff 128 26 aoû 20:27 .
drwxr-xr-x# 223 gb staff 7136 26 aoû 20:44 ..
-rw-r--r--# 1 gb staff 6148 26 aoû 21:04 .DS_Store
drwxr-xr-x# 3 gb staff 96 26 aoû 20:18 MyApplication.app
ld -la dist/MyApplication.app/Contents/Mac OS/
total 7016
drwxr-xr-x# 4 gauthierbtz staff 128 26 aoû 20:18 .
drwxr-xr-x# 7 gauthierbtz staff 224 26 aoû 20:18 ..
-rwxr-xr-x# 1 gauthierbtz staff 30048 26 aoû 20:18 PhoneBot_small
-rwxr-xr-x# 1 gauthierbtz staff 3557260 26 aoû 20:18 python
So I searched everywhere on the web to find solution but none worked.
As I know Qt5 can make issue when compiling, I made a search and found your article:
[https://doc.qt.io/qtforpython/deployment-pyinstaller.html](link url)
I decide to compile your python code shown in this article.
import sys
import random
from PySide2.QtWidgets import (QApplication, QLabel, QPushButton,
QVBoxLayout, QWidget)
from PySide2.QtCore import Slot, Qt
class MyWidget(QWidget):
def __init__(self):
QWidget.__init__(self)
self.hello = ["Hallo Welt", "你好,世界", "Hei maailma",
"Hola Mundo", "Привет мир"]
self.button = QPushButton("Click me!")
self.text = QLabel("Hello World")
self.text.setAlignment(Qt.AlignCenter)
self.layout = QVBoxLayout()
self.layout.addWidget(self.text)
self.layout.addWidget(self.button)
self.setLayout(self.layout)
# Connecting the signal
self.button.clicked.connect(self.magic)
#Slot()
def magic(self):
self.text.setText(random.choice(self.hello))
if __name__ == "__main__":
app = QApplication(sys.argv)
widget = MyWidget()
widget.resize(800, 600)
widget.show()
sys.exit(app.exec_())
Then I run the command:
pyinstaller --name="MyApplication" --windowed MyApp.py
And I get exact same issue :
LSOpenURLsWithRole() failed with error -10810 for the file /Users/gb/myapp/dist/MyApplication.app.
I wonder if anyone already faced this issue and found a solution?
The -10810 error message seems to be a catch-all for errors in the executable file inside the app. For example, I have an app called Hello.app, and inside Hello.app/Contents/MacOS is a single executable script named Hello with two lines:
#!/bin/sh
osascript -e "display dialog \"Hello, world!\""
When I issue the command:
open Hello.app
or double-click the folder icon in Finder. I see the expected dialog box:
However, when I introduce a syntax error:
osascript -e "display dialog "Hello, world!\""
the open command fails with the error message:
LSOpenURLsWithRole() failed with error -10810 for the file /full/path/name/of/Hello.app
To find the real error message, execute the program inside your app directly from the command line. In my case, the command is:
Hello.app/Contents/MacOS/Hello
and the much more informative error message is:
./Hello: line 2: unexpected EOF while looking for matching `"'
Of course, I have no idea what the actual error in your program is, but I hope this helps you find it!

Aosp does not have tools/vendor/google3 project

When I build Android Studio from source code using: 'bazel build //tools/adt/idea/...' command can't always find 'tools/vendor/google3' module, isn't google no open source project?
zhangyang#zhangyang-OptiPlex-7040:~/aosp/gradle_3.1.2$ bazel build //tools/adt/idea/...
WARNING: ignoring http_proxy in environment.
Starting local Bazel server and connecting to it...
..............................
ERROR: error loading package '': Encountered error while reading extension file 'binds.bzl': no such package '#blaze//': /home/zhangyang/.cache/bazel/_bazel_zhangyang/e54d4cb13781c1d72b64dc99700261fe/external/blaze must be an existing directory
ERROR: error loading package '': Encountered error while reading extension file 'binds.bzl': no such package '#blaze//': /home/zhangyang/.cache/bazel/_bazel_zhangyang/e54d4cb13781c1d72b64dc99700261fe/external/blaze must be an existing directory
INFO: Elapsed time: 0.621s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
the bazel WORKSPACE:
load("//tools/base/bazel:repositories.bzl", "setup_external_repositories")
setup_external_repositories()
local_repository(
name = "blaze",
path = "tools/vendor/google3/blaze",
)
load("#blaze//:binds.bzl", "blaze_binds")
blaze_binds()
http_archive(
name = "bazel_toolchains",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/b49ba3689f46ac50e9277dafd8ff32b26951f82e.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/b49ba3689f46ac50e9277dafd8ff32b26951f82e.tar.gz",
],
strip_prefix = "bazel-toolchains-b49ba3689f46ac50e9277dafd8ff32b26951f82e",
sha256 = "1266f1e27b4363c83222f1a776397c7a069fbfd6aacc9559afa61cdd73e1b429",
)
But Aosp does not have tools/vendor/google3 project
TL;DR:
bazel build is broken in AOSP
Use <studio-master-dev>/tools/idea/build_studio.sh instead
Or if you just want build a submodule inside tools/base , simply run gradle build. You might have to remove some dead dependencies from gradle.build but this shouldn't be difficult to fix.
Long version:
I had encountered the same error message, and took a look in the externaldirectory:
ls -lah ~/.cache/bazel/_bazel_xxx/89112fe8516b5fa5b01df0651312df31/external/
total 16K
drwxrwxr-x 2 xxx xxx 4.0K Dec 12 14:04 .
drwxrwxr-x 7 xxx xxx 4.0K Dec 12 14:04 ..
-rw-rw-r-- 1 xxx xxx 33 Dec 12 14:04 #bazel_tools.marker
lrwxrwxrwx 1 xxx xxx 110 Dec 12 14:04 bazel_tools -> /home/xxx/.cache/bazel/_bazel_xxx/install/35f799b1c96ee2522d30a28ff4ef485a/_embedded_binaries/embedded_tools
lrwxrwxrwx 1 xxx xxx 55 Dec 12 14:04 blaze -> /home/xxx/studio-master-dev/tools/vendor/google3/blaze
What is actually missing is /tools/vendor/google3/blaze. A quick Google search shows that blaze is an internal version of bazel, exclusively used within Google.
A thread in Android Studio's issue tracker also confirms that bazel build is broken in AOSP, with some bonus hints that build instructions in the studio-master-dev branch are all outdated (ouch). The issue is still open at the point of writing so if you are building Android Studio (or related tools), you might want to take a look at the latest discussion there.
Remove all references to tools/vendor/google from tools/base/bazel/toplevel.WORKSPACE:
https://android.googlesource.com/platform/tools/idea/+/refs/heads/studio-master-dev/RELEASE.md

Getting NPM error: "Resolving deps of app\app.ts failed."

I'm trying to install and utilize this brunch.io skeleton. I keep running into this error:
20 Apr 19:40:21 - info: application started on http://localhost:3333/
20 Apr 19:40:24 - info: compiling
20 Apr 19:40:28 - error: Resolving deps of app\app.ts failed. Could not load module 'app\home' from 'C:\Users\tyler.WORKGROUP\Documents\GitHub\zenith-folio\app'. Possible solution: add 'app' to package.json and `npm install`.
20 Apr 19:40:28 - error: Resolving deps of app\about\index.ts failed. Could not load module 'app\about\about.tpl' from 'C:\Users\tyler.WORKGROUP\Documents\GitHub\zenith-folio\app\about'. Possible solution: add 'app' to package.json and `npm install`.
20 Apr 19:40:28 - info: compiling.
20 Apr 19:40:29 - info: compiled 477 files into 2 files, copied index.html in 8.4 sec
I'm trying my best to understand what's going on here, but I'm not sure. I can see that I need to add "app" to package.json, but I don't know how or which "app" it's specifying. Is it talking about:
the folder called "app"
a file called app.ts
Or is there something else I'm missing?
Message is pretty clear: Could not load module 'app\home', it means that you have unresolved import in app.ts which possibly looks like import ... from 'app\home';

Problems with systemtap script

I wanna write a small script that identifies which function is using the mmap syscall:
#! /usr/bin/env stap
probe syscall.mmap.return {
if ( execname()=="java")
printf ("%s mmap caller\n", caller())
}
But it returns:
[root#gclimo01 stap]# stap -v mmap_caller.stp
Pass 1: parsed user script and 85 library script(s) using 198360virt/26732res/2944shr kb, in 210usr/50sys/264real ms.
Pass 2: analyzed script: 1 probe(s), 4 function(s), 4 embed(s), 0 global(s) using 355384virt/51680res/4048shr kb, in 650usr/350sys/1000real ms.
Pass 3: translated to C into "/tmp/stapwIxSzq/stap_a1823a5a24071fdf3118f618597b4ab6_7801_src.c" using 352824virt/54320res/6828shr kb, in 190usr/80sys/283real ms.
/tmp/stapwIxSzq/stap_a1823a5a24071fdf3118f618597b4ab6_7801_src.c: In function 'function_caller_addr':
/tmp/stapwIxSzq/stap_a1823a5a24071fdf3118f618597b4ab6_7801_src.c:646: error: dereferencing pointer to incomplete type
make[1]: *** [/tmp/stapwIxSzq/stap_a1823a5a24071fdf3118f618597b4ab6_7801_src.o] Error 1
make: *** [_module_/tmp/stapwIxSzq] Error 2
WARNING: make exited with status: 2
Pass 4: compiled C into "stap_a1823a5a24071fdf3118f618597b4ab6_7801.ko" in 1170usr/1120sys/2207real ms.
Pass 4: compilation failed. Try again with another '--vp 0001' option.
My systems is RHEL 6.3, Linux xxxxxxxxx 2.6.32-279.1.1.el6.x86_64 #1 SMP Wed Jun 20 11:41:22 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
any tip ?
This was http://sourceware.org/bugzilla/show_bug.cgi?id=14079, fixed in systemtap 1.8 with
commit 4107dbc2c88536c3374a68948c7344af8c8e75aa
Author: Mark Wielaard <mjw#redhat.com>
Date: Tue May 8 19:59:07 2012 +0200
PR14079 - caller() pass-4 error if no uretprobes in script
caller() is odd in that it tries to do both kernel and user caller.
There is no ucaller(). Move it into its own tapset and include the
right uprobes related structures.
* runtime/uprobes-inc.h: New include file to be included in ...
* runtime/stack.c: here and ...
* tapset/context-caller.stp: here. New tapset, with just the caller context
function, removed from ...
* tapset/context-unwind.stp: here.
* doc/SystemTap_Tapset_Reference/tapsets.tmpl: Also include context-caller.stp.

IPSEC tool Racoon Crashes and can't restart it

I'm using a PowerBook Pro running Mac OSX 10.6.6 (Snow Leopard). I have been connecting to a client server using the built in VPN connector for months. Yesterday my connection wouldn't connect and was timing out. I checked with other remote developers and they had the same issue. The resolved it by killing the "racoon" process. I did the same and VPN connected.
I googled Racon to discover that it is an IPsec tool (http://ipsec-tools.sourceforge.net/)
This morning I had the same issue. I decided to first try to flush the info by using the racoonctl app to run:
sudo racoonctl flush-sa ipsec
That didn;t work, so I decided to just kill the process. Sadly, I do not have a racoon process running now. So I rebooted. Still not process. I rebooted again and ran fsck. Still nothing.
I looked in the logs and it seems that racoon is crashing every 10 seconds (see below).
Anybody have any ideas on what I need to do to get this back up and running? This has seemed to happen out of the blue and it is eating up my time seriously at this point.
System Error:
__TEXT [0x100000000 - 0x10008f000) __eh_frame [0x1000821e8 - 0x10008eff8) /usr/sbin/racoon
Mar 9 12:35:11 pmolaro com.apple.launchd[1] (com.apple.racoon[2458]): Job appears to have crashed: Segmentation fault
Mar 9 12:35:11 pmolaro com.apple.launchd[1] (com.apple.racoon): Throttling respawn: Will start in 10 seconds
Mar 9 12:35:11 pmolaro com.apple.ReportCrash.Root[2454]: 2011-03-09 12:35:11.638 ReportCrash[2454:301b] Saved crash report for racoon[2458] version ??? (???) to /Library/Logs/DiagnosticReports/racoon_2011-03-09-123511_localhost.crash
Crash Report:
Process: racoon [720]
Path: /usr/sbin/racoon
Identifier: racoon
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: launchd [1]
Date/Time: 2011-03-09 10:42:19.831 -0500
OS Version: Mac OS X 10.6.6 (10J567)
Report Version: 6
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000000000000000d, 0x0000000000000000
Crashed Thread: 0
Thread 0 Crashed:
0 dyld 0x00007fff5fc01723 dyld::setNewProgramVars(ProgramVars const&) + 64
1 dyld 0x00007fff5fc0d8d9 ImageLoaderMachO::setupLazyPointerHandler(ImageLoader::LinkContext const&) + 297
2 dyld 0x00007fff5fc18a19 ImageLoaderMachOCompressed::doBind(ImageLoader::LinkContext const&, bool) + 57
3 dyld 0x00007fff5fc0b5a2 ImageLoader::recursiveBind(ImageLoader::LinkContext const&, bool) + 122
4 dyld 0x00007fff5fc0c81b ImageLoader::link(ImageLoader::LinkContext const&, bool, bool, ImageLoader::RPathChain const&) + 171
5 dyld 0x00007fff5fc04d48 dyld::link(ImageLoader*, bool, ImageLoader::RPathChain const&) + 118
6 dyld 0x00007fff5fc068d6 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**) + 2822
7 dyld 0x00007fff5fc016d2 dyldbootstrap::start(macho_header const*, int, char const**, long) + 799
8 dyld 0x00007fff5fc01052 _dyld_start + 42
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000001 rbx: 0x00000001000003c8 rcx: 0x0000000000000000 rdx: 0x0921b00000000100
rdi: 0x000000010008fac0 rsi: 0x00007fff5fc277c1 rbp: 0x00007fff5fbfdac0 rsp: 0x00007fff5fbfdac0
r8: 0x00007fff5fc444b0 r9: 0x0000000000000001 r10: 0x00007fff893d5d3f r11: 0x00007fff5fc0d6aa
r12: 0x00000001000002e0 r13: 0x0000000000000002 r14: 0x0000000100000000 r15: 0x00007fff5fc43be8
rip: 0x00007fff5fc01723 rfl: 0x0000000000010206 cr2: 0x000000010008f048
Binary Images:
0x100000000 - 0x10008eff7 +racoon ??? (???) /usr/sbin/racoon
0x1000a0000 - 0x1000a5fef libipsec.A.dylib 300.0.0 (compatibility 1.0.0) /usr/lib/libipsec.A.dylib
0x7fff5fc00000 - 0x7fff5fc3bdef dyld 132.1 (???) /usr/lib/dyld
0x7fff80008000 - 0x7fff8000dfff libpam.2.dylib 3.0.0 (compatibility 3.0.0) /usr/lib/libpam.2.dylib
0x7fff8125e000 - 0x7fff8141ffff libSystem.B.dylib 125.2.1 (compatibility 1.0.0) /usr/lib/libSystem.B.dylib
0x7fff81528000 - 0x7fff817aefff com.apple.security 6.1.1 (37594) /System/Library/Frameworks/Security.framework/Versions/A/Security
0x7fff817d8000 - 0x7fff81815fff com.apple.LDAPFramework 2.0 (120.1) /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
0x7fff81c85000 - 0x7fff81c89ff7 libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) /usr/lib/system/libmathCommon.A.dylib
0x7fff81fcf000 - 0x7fff81fefff7 com.apple.DirectoryService.Framework 3.6 (621.9) /System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryService
0x7fff8259a000 - 0x7fff82617fef libstdc++.6.dylib 7.9.0 (compatibility 7.0.0) /usr/lib/libstdc++.6.dylib
0x7fff82618000 - 0x7fff827d6fff libicucore.A.dylib 40.0.0 (compatibility 1.0.0) /usr/lib/libicucore.A.dylib
0x7fff82831000 - 0x7fff82952fe7 libcrypto.0.9.8.dylib 0.9.8 (compatibility 0.9.8) /usr/lib/libcrypto.0.9.8.dylib
0x7fff829cf000 - 0x7fff82a85fff libobjc.A.dylib 227.0.0 (compatibility 1.0.0) /usr/lib/libobjc.A.dylib
0x7fff82cca000 - 0x7fff82cebfff libresolv.9.dylib 41.0.0 (compatibility 1.0.0) /usr/lib/libresolv.9.dylib
0x7fff84b80000 - 0x7fff84b91ff7 libz.1.dylib 1.2.3 (compatibility 1.0.0) /usr/lib/libz.1.dylib
0x7fff84c47000 - 0x7fff84c59fe7 libsasl2.2.dylib 3.15.0 (compatibility 3.0.0) /usr/lib/libsasl2.2.dylib
0x7fff85fb4000 - 0x7fff86000fff libauto.dylib ??? (???) /usr/lib/libauto.dylib
0x7fff862a8000 - 0x7fff862e2fff libssl.0.9.8.dylib 0.9.8 (compatibility 0.9.8) /usr/lib/libssl.0.9.8.dylib
0x7fff86ac2000 - 0x7fff86ac3ff7 com.apple.TrustEvaluationAgent 1.1 (1) /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent
0x7fff8735e000 - 0x7fff87374fef libbsm.0.dylib ??? (???) /usr/lib/libbsm.0.dylib
0x7fff87375000 - 0x7fff8746dff7 libiconv.2.dylib 7.0.0 (compatibility 7.0.0) /usr/lib/libiconv.2.dylib
0x7fff87593000 - 0x7fff875d4fff com.apple.SystemConfiguration 1.10.5 (1.10.2) /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x7fff87ae1000 - 0x7fff87c58fe7 com.apple.CoreFoundation 6.6.4 (550.42) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x7fff87e02000 - 0x7fff87ebbfff libsqlite3.dylib 9.6.0 (compatibility 9.0.0) /usr/lib/libsqlite3.dylib
0x7fff883a0000 - 0x7fff8844ffff edu.mit.Kerberos 6.5.10 (6.5.10) /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
0x7fffffe00000 - 0x7fffffe01fff libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib
I finally resolved my own issue. I used TimeMachine to replace the /usr/sbin/racoon and /usr/sbin/racoonctl files and rebooted my system. Now VPN works as expected. I am guessing that one of those files (probably racoon) was corrupted somehow.
On a side note, I did call Apple to get some help. I was willing to pay the support fee to get this issue resolved. After they read my information on this page I was informed that this issue was "beyond their technical training." I asked if I could speak to a higher level tech who would know something about the underpinnings of the OS and was told that wasn't an option. The tech finally recommended that I spend an hour and re-install my OS to fix the issue. Never once suggested TimeMachine either.
Moral of that story: Unless you need to know how to connect your printer or surf the web in an iPad, you probably don;t want to waste your time or money with Apple support. Sorry Apple, in this you have failed me! :(

Resources