Dive into the world of programming languages used for app development.

Post

Replies

Boosts

Views

Activity

Flutter barcode_scan2: ^4.3.3 non funziona bene su iOS
Stiamo sviluppando una App per iOS con Flutter, usiamo: Flutter barcode_scan2: ^4.3.3. Gli smartphone iOS cercano di riconoscere il tipo di codice a barre letto. Se il sistema crede che il codice sia gtin13 ma le cifre risultano 12, aggiunge uno zero iniziale. Come potremmo risolvere ? Grazie Settore sviluppo App Firenze Web Division
1
0
230
Oct ’24
Application doesn't start: Namespace DYLD, Code 1 Library missing
I have a multi-platform application made with Delphi which uses FTDI D2XX drivers. All is well in other platforms but i have this issue in MacOS when i try to start the application: Termination Reason: Namespace DYLD, Code 1 Library missing Library not loaded: libftd2xx.dylib Referenced from: <CD2148C0-F76F-35D5-8E65-2BE51F201302> /Users/USER/*/USB_Editor.app/Contents/MacOS/USB_Editor Reason: tried: 'libftd2xx.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibftd2xx.dylib' (no such file), 'libftd2xx.dylib' (no such file), '//libftd2xx.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS//libftd2xx.dylib' (no such file), '//libftd2xx.dylib' (no such file) (terminated at launch; ignore backtrace) If i try to run the executable i get a similar error which includes the users/user folder in the paths specified above. So if i copy libftd2xx.dylib to users/user the app can start from the executable and the USB library works well. The library is bundled in Contents/Framework as this seems to be the best (or only) accepted practice. Btw the app only starts during deployment if the library is found in Contents/MacOS. Library version is the most recent from FTDI site for the ARM architecture and followed their instructions to install. If i try the otool command on the library i get this: otool -L libftd2xx.dylib libftd2xx.dylib: libftd2xx.dylib (compatibility version 1.1.0, current version 1.4.30) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.61.1) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 2202.0.0) I'm a Mac user since last week so my knowledge of the system is not so good yet (:
2
0
310
Oct ’24
Applescript text item delimiters not working
I have a string of the form “Mon 22nd April”. I’m trying to extract the day (i.e. Mon), the date (i.e. 22nd) and the month (i.e. April) using this Applescript: set originalDateString to “Mon 22nd April” -- Extract the components by splitting the string set AppleScript's text item delimiters to " " set dayOfWeekAbbrev to text item 1 of originalDateString set dayOfMonth to text item 2 of originalDateString set monthName to text item 3 of originalDateString When I run this on its own it works as expected: dayOfWeekAbbrev is set to “Mon” dayOfMonth is set to “22nd” monthName is set to “April” When I run this inside a bigger script involving Numbers, the text item delimiters fails to work, no compile or run time errors occur and I end up with: dayOfWeekAbbrev is set to “M” dayOfMonth is set to “o” monthName is set to “n” I.e the first three characters of the string. If I replace originalDateString with the literal string “Mon 22nd April” I get the same result. In other words, text items and being recognized as individual characters, no delimiter (or delimiter is null). Totally confused.
5
0
366
Oct ’24
Undefined symbols for architecture x86_64:
I am developing a simple camera JNI interface program in Objc. I managed to compile. But I get the following link error. I use the following command. Is there anything I can add to solve this problem? Note that I use Intel MacMini. g++ -framework Foundation -framework AVFoundation CameraMacOS.m Undefined symbols for architecture x86_64: "_CMVideoFormatDescriptionGetDimensions", referenced from: _openCamera in CameraMacOS-517c44.o _listWebcamNamesAndSizes in CameraMacOS-517c44.o "_CVPixelBufferGetBaseAddress", referenced from: -[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o "_CVPixelBufferGetBytesPerRow", referenced from: -[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o "_CVPixelBufferGetHeight", referenced from: -[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o "_CVPixelBufferGetWidth", referenced from: -[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o "_CVPixelBufferLockBaseAddress", referenced from: -[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o "_CVPixelBufferUnlockBaseAddress", referenced from: -[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
2
0
322
Oct ’24
C++
Hi To All. I have recently started a course that will teach me how to use C++ coding, so I can improve my career prospects. I have come across an obstacle when it comes to downloading a programming tool and that is, they are not compatible with Sequoia 1.15.1. This includes Xcode, Clion, Codelite and Vs, I am at a crossroads in my decision making on how to overcome this problem please. Can someone help withme with a solution please. Thank you.
2
0
301
Oct ’24
Why is there a problem passing parameters from Swift to the shared Kotlin class when developing iOS applications using Kotlin Multiplayer Development in Android Studio
I use Kotlin Multiplayer Development to develop iOS applications. I access the methods in the Kotlin class of the shared module in the ContentView.swift file. Functions without parameters can be used normally, but functions with parameters cannot. For example, the 78th line of code on the left side of the screenshot works, but the 79th line does not. Can someone please tell me the reason? Thank you!
1
0
371
Oct ’24
Is there any way to write a screensaver for macOS using Python Pygame?
I want to be able to write a cross-platform screensaver that works on both Windows and macOS using the Pygame 2D graphics library in Python. On Windows, this is super easy - you just write your program with three possible command line arguments: /p for preview mode, /c for the configuration dialog mode, and /s for the actual full-screen screensaver mode. Then you just use pyinstaller to build an .exe file and rename the extension to .scr, and you're good to go. However, it seems that making a screensaver on macOS is a pretty convoluted process, and there was stuff about specific Objective-C functions that you had to write, and I didn't really understand the documentation. Could you please tell me if there is any way to simply get my Python Pygame program to build as a proper .saver file? Thanks!
1
0
227
Oct ’24
Trace/BPT trap in very simple C code compiled with clang
I wonder if this is correct behavior. I was surprised to get this result when compiling and running the following C code with Apple clang version 14.0.0 (clang-1400.0.29.102) target arm64-apple-darwin21.6.0 on a M1 Pro 12.7.6 with cc -O2 file.c: #include <stdio.h> #include <stdlib.h> unsigned long long factorial(int n) { unsigned long long fac = 1; while (n > 0) fac *= n; return fac; } int main() { return factorial(1); } Compiling with -O2 and running this code gives "Trace/BPT trap". Checking with LLDB: $ lldb ./a.out (lldb) target create "./a.out" Current executable set to '/Users/engelen/Projects/Euler/a.out' (arm64). (lldb) run Process 79580 launched: '/Users/engelen/Projects/Euler/a.out' (arm64) Process 79580 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x100003fb4) frame #0: 0x0000000100003fb4 a.out`main at 20.c:9:3 [opt] 6 unsigned long long fac = 1; 7 while (n > 0) 8 fac *= n; -> 9 return fac; 10 } 11 12 int main() The loop is non-terminating. But a breakpoint trap is triggered at the return statement. The code should just hang in the loop IMO, not trap, because it never updates variable n (a correct factorial function should decrement n). Never seen this before (not since I started wiring C code in the 80s.) If I change the update *= into += then there is no trap.
1
0
230
3w
Crash due to missing symbols from libc++ [macOS 11.7.10] [Big Sur]
We are seeing a crash on Big Sur 11.7.10 after switching the build system to use Xcode 15 Excerpt from crash Time Awake Since Boot: 1700 seconds System Integrity Protection: enabled Crashed Thread: 0 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: DYLD, [0x4] Symbol missing Application Specific Information: dyld: launch, loading dependent libraries Dyld Error Message: Symbol not found: __ZNSt3__17codecvtIDiDu11__mbstate_tE2idE Referenced from: /Applications/SecureworksTaegis.app/Contents/MacOS/com.secureworks.agent.daemon.app/Contents/MacOS/com.secureworks.agent.daemon Expected in: /usr/lib/libc++.1.dylib in /Applications/SecureworksTaegis.app/Contents/MacOS/com.secureworks.agent.daemon.app/Contents/MacOS/com.secureworks.agent.daemon Build system has the following specs : ProductName: macOS ProductVersion: 14.3.1 BuildVersion: 23D60 Xcode 15.2 Build version 15C500b CMAKE PROPS set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
5
0
342
3w
Token is not a valid binary operator in a preprocessor subexpression
I have a relatively unique project layered with file types (top to bottom) SwiftUI, Swift, Objective C, and C. The purpose of this layering is that I have a C language firmware application framework for development of firmware on custom electronic boards. Specifically, I use the standard C preprocessor in specific ways to make data driven structures, not code. There are header files shared between the firmware project and the Xcode iPhone app to set things like the BLE protocol and communication command/reply protocols, etc. The app is forced to adhere to that defined by the firmware, rather than rely a design to get it right. The Objective C code is mainly to utilize the Bluetooth stack provided by iOS. I specifically use this approach to allow C files to be compiled. Normally, everything has worked perfectly, but a serious and obtuse problem just surfaced a couple days ago. My important project was created long ago. More recently, I started a new project using most of the same technology, but its project is newer. Ironically, it continues to work perfectly, but ironically the older project stopped working. (Talking about the Xcode iOS side.) Essentially, the Objective C handling of the C preprocessor is not fully adhering to the standard C preprocessing in one project. It's very confusing because there is no code change. It seems Xcode was updated, but looks like the project was not updated, accordingly? I'm guessing there is some setting that forces Objective C to adhere to the standard C preprocessor rules. I did see a gnu compiler version that did not get updated compared to the newer project, but updating that in the Build Settings did not fix the problem. The error is in the title: Token is not a valid binary operator in a preprocessor subexpression. The offending macro appears in a header file, included in several implementation files. Compiling a single implementation files isolates the issue somewhat. An implementation with no Objective C objects compiles just fine. If there are Objective C objects then I get the errors. Both cases include the same header. It seems like the Objective C compiler, being invoked, uses a different C preprocessor parser, rather than the standard. I guess I should mention the bridging header file where these headers exist, as well. The offending header with the problem macro appears as an error in the bridging header if a full build is initiated. Is there an option somewhere, that forces the Objective C compiler to honor the standard C processor? Note, one project seems to. #define BLE_SERVICE_BLANK( enumTag, uuid, serviceType ) #define BLE_CHARACTERISTIC_BLANK( enumTag, uuid, properties, readPerm, writePerm, value) #define BLE_SERVICE_ENUM_COUNTER( enumTag, uuid, serviceType) +1 #define BLE_CHARACTERISTIC_ENUM_COUNTER( enumTag, uuid, properties, readPerm, writePerm, value) +1 #if 0 BLE_SERVICE_LIST(BLE_SERVICE_ENUM_COUNTER, BLE_CHARACTERISTIC_BLANK) &gt; 0 #define USING_BLE_SERVICE ... #if 0 BLE_SERVICE_LIST(BLE_SERVICE_BLANK, BLE_CHARACTERISTIC_ENUM_COUNTER) &gt; 0 #define USING_BLE_CHARACTERISTIC ... token is not a valid binary operator in a preprocessor subexpression refers to the comparison. BLE_SERVICE_LIST() does a +1 for each item in the list. There is no further expansion. One counts services. The other counts characteristics. The errors are associated with the comparisons.
8
0
277
2w
Is it possible to execute machine code on iOS with permission
When Xcode is connected to the mobile phone for debugging, the app that contains the logic of executing machine code runs normally, but if Xcode is disconnected and the app is run alone, it will crash. First use the xcode-run execution function to start the app The machine code logic executes normally Disconnect the phone from xcode Start the app 5.Crash Here is the test code:https://gitee.com/FanChiang_admin/demo.git
1
0
161
2w
clang multiarch doens't work with precompiled headers
So I found out clang can do multiarch compiles (-arch arm64 -arch x86_64). But Apple seems to have left precompiled header support out. So I built the pch separately for each arch. That all works. The next problem is that one needs to specify -include-pch foo.x64.pch and -include-pch foo.arm64.pch on the command line. This doesn't work on the compile line, since it tries to prepend arm64 AST to a x64 .o file, and vice versa. So there is -Xarch_arm64 and -Xarch_x86_64 . But that option is limited to one argument. But "-include-pch foo.x64.pch" is two arguments. More details of failed attempts here: https://github.com/llvm/llvm-project/issues/114626 And no splitting out the builds isn't the same, because then -valid_arch I don't think skips the other build. This are all libraries being built by Make, and then the universal app built using an Xcode project from the libraries.
2
0
202
2w
using Swift Library from c++ code - calllbacks ?
Hello, Im developing an app entirely with C++, and I need to call various swift functions because it requires the Swift library. Ive seen several posts on forums about C++ callbacks and honestly I dont understand how its done exactly. I get the general idea but I am not able to understand it and make it work. I feel like people throw vague ideas and weird function names and everything gets confusing. Could anyone give me the smallest example that works please ? Just to make sure you know what I mean, here is an example of what I want to do, but you dont have to generate the code exactly for this, I want an example that I can understand please, but the swift code has to depend on a swift library. I dont want to simply call a swift function that returns x*2 ... {1} notif.swift file : coded in swift language include <UserNotifications/UserNotifications.h> function A that show notification in swift code. {2} mainwindow.cpp file : coded in C++ language import notif.swift ?? button connected to slot/function mybuttonclicked. MainWindow::mybuttonclicked(){ std::string my_result = call function A_from_swift_file(argument_1); } --The end --- I wrote the notif.swift with '?' because I dont know how you include the swift file from your cpp code and I could not find that anywhere. Maybe it is obvious, but I would really appreciate getting some help on this, Thank you everyone
3
0
194
1w