Adobe Air app for iOS only works in interpreter mode? - ios

I have an Adobe Air application that I am packaging for iOS.
If the target is ipa-debug-interpreter or ipa-test-interpreter the app works just fine. However, any other target it crashes when trying to use assets. I have seen the following exception:
[Fault] exception, information=ReferenceError: Error #1065: Variable FlexVersion is not defined.
Fault, SpriteAsset() at SpriteAsset.as:131
131 if (appDomain.hasDefinition("mx.core::FlexVersion"))
Other times it will crash with no stack.
Why would it only work when the target includes interpreter?

Packaging with interpreter is faster than the regular debug packaging (not that I've ever noticed a timetable difference). I would hazard a guess that for it to be faster it must bypass certain processes which the normal debug would check for. From the type of error you're getting I would suggest you double check your manifest XML file for missing packages and/or the version of the AIR SDK you are targeting. Hope this provides some help.
EDIT: May also be worth revision which version of the FLEX SDK you are targeting and this can cause issues of this kind.

Related

How to debug iOS linking / framework embedding issues in KMM projects?

I'm new to KMM but I really wanna get into it. It is obvious that I will make a lot of mistakes during my journey. What makes me a little bit frustrated is, that I'm not able to translate given errors to the reason why it happen. I'm working on a M1 Mac mini.
It would be awesome if someone could show me how he / she would investigate the following issue:
Issue
Does anyone know what causes an error if I try to build iOS:
Task
> Task :shared:compileKotlinIosSimulatorArm64 UP-TO-DATE
./gradlew :shared:embedAndSignAppleFrameworkForXcode
Log
/Users/.../iosApp/ld:1:1: object file (/var/folders/yt/4pjlxzfn48n28yxvdsnrw6n40000gn/T/included3352453535999755831/libparticles.a(libparticles.SkParticleBinding.o))
was built for newer iOS Simulator version (15.2) than being linked (9.0)
I'm using the "Regular framework" approach.
What I already did
Checked the project of "9 occurrences because of the mentioning of iOS 9
I checked my versions, but maybe I have a Version mismatch somewhere in my Kolin code?
I created it freshly new
Gist
Full stacktrace:
https://gist.github.com/tscholze/6d67bc21a2b8e1bdc575e6b80ca8af2b

Lexical or preprocessor issue in react native while building ios app <React/RCTUtils.h> not found

When I am trying to build my ios app in xcode, the build is failing due to lexical or preprocessor issue the error shows up like this
This was a problem specific to the react-native-device-info module.
For your specific case you may try v1.6.1 or higher (currently at 2.0 as of May 21, 2019) of the library and that should fix things for you.
For others interested more generally in the problem, this is a react-native library that uses native code, so it has an XCode project embedded within it for use in react-native after you run react-native link react-native-device-info. Unfortunately, the library was not including any directories in it's header search path, so it was of course unable to find the header files for the react-native objects it was using locally.
A library user proposed a change that fixed that problem for tvOS, and I extended the change to cover iOS as well, and now the library no longer generates errors like this for iOS or tvOS targets.
Perhaps someone with a similar issue may find the specific changes required for the fix useful in their projects

fopen$UNIX2003 fails inside external library

I have an external static library (I have the source code as well) that uses 'fopen' to access files on the filesystem. The strange thing is that it always fails both on simulator and device when it tries to do so with EXE_BAD_ACCESS inside fopen$UNIX2003 (not in fopen, fopen is not even in the call stack when the exception is thrown. I've tried to use fopen directly myself with the same path/options and it works. So, first of all, is it possible that the library is somehow calling a different fopen implementation? If so, why, and most important how can I make it call the 'right' one?
EDIT: Actually, the last function in the call stack before the exception is thrown is _interposition_vtable_unimplemented, fopen$UNIX2003 precedes it.
fopen$UNIX2003 is a symbol that is provided by OS X and is not part of the iOS Simulator runtime. iOS is always conformant and thus does not have legacy (non $UNIX2003) variants of functions (which are provided for binary compatibility with code built against older versions of the OS X SDK).
The common cause of the issue you are seeing is that you have an object file or archive (libsomething.a) that was built against the OS X SDK and are trying to link it into your iOS Simulator executable. That is not supported as the two platforms are not binary compatible at that layer.
You need to rebuild your library (the libsomething.a) against the iOS Simulator SDK.
This problem results in an abort at runtime on iOS 7 but is now a link error at build time on iOS 8, and that seems to have helped make these issues much more obvious.

is it prohibited using of JIT(just-in-time) compiled code in iOS app for AppStore?

I heard that JIT compiled code is not allowed in iOS AppStore because placing executable code in heap is prohibited. It that right? Or just a rumor?
Installable code isn't allowed ("or" is the key word in 3.3.2). Everything (except Javascript) has to be statically linked.
JIT compiling into Javascript source code text appears to be allowed. (Not a joke, there is a commercial compiler that does this.) Compiling into bytecode for execution by an interpreter written Javascript and running in a UIWebView may confuse the reviewers enough to possibly reject an app doing that.
The iOS security sandbox will likely kill any app that tries to jump into any dynamically generated data.
That is right.
You can read in the iOS standard agreement, which you need to accept when setting up your developer enrollment:
3.3.2 An Application may not download or install executable code.
Interpreted code may only be used in
an Application if all scripts, code
and interpreters are packaged in the
Application and not downloaded. The
only exception to the foregoing is
scripts and code downloaded and run by
Apple's built-in WebKit framework.
JIT compiling into Javascript source code text appears to be allowed. (Not a joke, there is a commercial compiler that does this.) Compiling into bytecode for execution...
I also made my thoughts about a compiler (not JIT but real programming language) running on iOS. My idea was using addresses to assembler-written functions implementing pseudo-opcodes as instructions instead of "traditional bytecode" (1 byte per pseudo-opcode).
One ARM register is reserved as "code pointer" (here named "rCP") pointing into my "bytecode". The last instruction of a pseudo-opcode-function is "ldmfd rCP!, {pc}". This means the last instruction of the function is not a "return" but a jump into the next opcode.
Using this method you get very fast "bytecode". Maybe the commercial compiler works like this. I cannot believe that there is a JIT compiler running native code on iOS.

Compiling AIR to iOS throws a java error

I have a flash app, that we are re-purposing for iPad. I can compile it happily to AIR 2, and can debug it as an iOS app (ctrl+enter, and ctrl+shift+enter) - but when I try to actually publish it I get a Java error - not a compiler error, but an error with the compiler itself if that makes sense. The error is below - sorry for any typos, but you can't copy and paste the error message:
Error creating files.
Exception in thread "main" java.lang.Error: Method 1207 is referenced more than once.
at abobe.abc.LLVMEmitter.referenceMethod(LLVMEmitter.java:3440)
at abobe.abc.LLVMEmitter.access$2300(LLVMEmitter.java:44)
at abobe.abc.LLVMEmitter$MethodEmitter.emitBlock(LLVMEmitter.java:2854)
at abobe.abc.LLVMEmitter$MethodEmitter.emit(LLVMEmitter.java:1426)
at abobe.abc.LLVMEmitter.emitMethods(LLVMEmitter.java:3963)
at abobe.abc.LLVMEmitter.emit(LLVMEmitter.java:3835)
at abobe.abc.LLVMEmitter.processABCs(LLVMEmitter.java:206)
at abobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:174)
at com.adobe.air.ipa.AOTCompiler.convertAbcToLlvmBitcode(AOTCompiler.jav a:329)
at com.adobe.air.ipa.AOTCompiler.GenerateMacBinary(AOTCompiler.java:600)
at com.adobe.air.ipa.IPAOutputStream.compileRootSwf(IPAOutputStream.java :196)
at com.adobe.air.ipa.IPAOutputStream.finalizeSig(IPAOutputStream.java:35 5)
at com.adobe.air.ADTPackager.createPackage(ADTPackager.java:65)
at com.adobe.air.ipa.IPAPackager.createPackage(IPAPackager.java:165)
at com.adobe.air.ADTEntrypoint.parseArgsAndGo(ADTEntrypoint.java:132)
at com.adobe.air.ipa.PFI.parseArgsAndGo(PFI.java:152)
at com.adobe.air.ADTEntrypoint.run(ADTEntrypoint.java:68)
at com.adobe.air.ipa.PFI.main(PFI.java:112)
This happens regardless of deployment type, or rendering option. I know the certificates, and provisioning profile are correct as when I remove the Class in the .fla itself it compiles quite happily and can be put onto our dev iPad (obviously it just doesn't do anything).
Can anyone shed any light on this as I am not sure even where to start.
EDIT: This is with Flash CS5 running on XP64 if that is of any help.
try using the ADT.BAT command, it worked for us.
First, make sure your Flash Pro CS5 is up to date: http://www.adobe.com/support/flash/downloads.html
You can post a question in the Adobe Forum here: http://www.AdobeAssistance.com
Read the Adobe FAQ for iOS (make sure you are not using unsupported libraries, etc...): http://labs.adobe.com/wiki/index.php/Packager_for_iPhone:Developer_FAQ
I would read the FAQ and make sure my Flash is up to date with the latest version and try it again. If it fails I would post this question on the Adobe Forum.
It has something to do with debug information being present in the SWF. The only solution is to compile the AIR application via the command line and with the include libraries parameter:
"c:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.1.0\bin\amxmlc" .\src\YourApp.mxml -compiler.include-libraries

Resources