Adobe Animate AIR 30/32 Invalid Bitcast - actionscript-3

I am getting Invalid Bitcast error when trying to compile with Adobe AIR SDK for app store.
What I've tried:
Tried with SDK 30 and SDK 32 - same error
Removed temporary files
Removed all ANEs
I tried removing all code and it worked
I built a similar app and it worked
Tried reinstalling Adobe Animate
At some point it worked, I managed to create builds for Ad Hoc and App store distribution
I believe it could be something related either to code (but not sure why it worked before) or maybe it is something outside of the app files and code.
Any suggestions will be appreciated.
Thank you
UPDATE
After commenting and uncommenting the code to find out where is the error, it turns out that "row.bg.gotoAndStop(x)" is generating the error. No idea why. I commented these lines and now I can build
if (win == null) {
//row.bg.gotoAndStop(1);
}
else if (win == true)
{
//row.bg.gotoAndStop(2);
}
else if (win == false)
{
//row.bg.gotoAndStop(3);
}

Related

flashdevelop error while loading initial content

I have been struggling with this stupid error from couple of hours. Have tried everything but it still persists. I'm unable to run any Flash Mobile AS3 project in FlashDevelop.
This is what it says in Output panel:
Debugger startup error. For troubleshooting see: http://www.flashdevelop.org/wikidocs/index.php?title=F.A.Q
Error details: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at net.sf.jni4net.jni.JNI.Dll.JNI_GetDefaultJavaVMInitArgs(JavaVMInitArgs* args)
at net.sf.jni4net.jni.JNI.Init()
at net.sf.jni4net.jni.JNI.CreateJavaVM(JavaVM& jvm, JNIEnv& env, Boolean attachIfExists, String[] options)
at net.sf.jni4net.Bridge.CreateJVM()
at net.sf.jni4net.Bridge.CreateJVM(BridgeSetup setup)
at FlashDebugger.DebuggerManager.Start(Boolean alwaysStart)
[Capturing traces with FDB]
and this is what it shows in the console/command prompt:
error while loading initial content
Please if anyone had seen this error and solved it successfully, I would really appreciate any help. Screenshot attached below.
Thanks!
Looks like you are using wrong Java SDK version 64 bit rather than 32 bit which FlashDevelop requires

Access MySQL server from Objective-C project with ARC

I can't seem to find a solution to access a MySQL server from an Objective-C Mac OS project (which uses ARC).
I tried to use the MySQL framework that Sequel Pro provides, but that crashes (EXC_i386_GPFLT) my App whenever I just create a connection object:
SPMySQLConnection *conn = [[SPMySQLConnection alloc] init];
I don't know whether that is a bug in the framework or if I need to do something else in order to use it.
I tried a few other libraries (like MySqueakQl) but none of them are ARC compatible.
Also I tried to link to libmysqlclient.a directly, but if I copy that library into my project, I get a code signing error; if I just link to the .a in /usr/local/mysql/lib/, I get another error: dyld: Library not loaded: libmysqlclient.18.dylib ... Reason: image not found. I have to admit that I have zero experince with using third-party libraries (whether .a or .dylib) and probably didn't do it right.
I'm a bit surprised that there doesn't seem to be an up-to-date (read: working) solution out there. I know, consumer apps rather use Core Data, but I have to access out company database server.
Has anybody seen a solution (libary?) that works more or less "out of the box"? I'd be willing to pay for something that actually works.
A good tutorial on how to use .a libraries in Xcode projects that would also help me to understand where the dylib error comes from would also be very helpful.
Problem solved. I probably made some mistake when including the library.
The right steps to do this:
Drag the libmysqlclient.a library into your project window
Make sure you set Copy items if needed to Yes, and that it is added to your main target
Drag a folder containing the headers (found under /usr/local/mysql/include) into your project window
Again, make sure you set Copy items if needed to Yes and the correct target is checked.
Then:
#import "mysql.h"
- (BOOL) mySQLTest {
MYSQL connection;
mysql_init(&connection);
if(!mysql_real_connect(&connection,
[self.host UTF8String],
[self.user UTF8String],
[self.password UTF8String],
[self.database UTF8String],
self.port,
NULL,
0)) {
return NO;
}
// ... work with the DB
mysql_close(&connection);
return YES;
}
Works like a charm.
I have no idea why on my former attempts I got an error about the dylib; I never used it (only the static library).
The code signing issue may have been just a bug or one-time quirk in Xcode.

Air publishing game error

I receive this error durring the publishing of my game.
Error creating files. dx tool failed :
UNEXPECTED TOP-LEVEL EXCEPTON: java.lang.illegalArgumentException:
already added : android/support/v7/appcomapt/R$anim;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java.123)....
(is long error)
I have included an ane for ads (AIRPUSH)
When I run that ane in new project it's working perfectlly.
What can be the problem?
I've faced this one before.
The exception tells you that the android-support-v7 library's R class (See R* mechanism with ANEs) is being packaged twice. Which explains why it works fine with a new ANE project.
Please check if you have them included inside your ANE's platform.xml as a <packagedResource> (If so remove it from here)
OR
Check if it is being added from inside one of your other ANEs.

Failed to resolve Android.App.Fragment with Link SDK Only enabled

I'm getting compile time error when linker option = "SDK Only" with "Failed to resolve Android.App.Fragment" message. It's all started when I added Google Maps support with FragmentActivity to my MonoDroid application.
With Linker option = "None" everything works just fine except of the fact that .apk became huge (~30mb instead of 7mb when link SDK Only enabled)
Error details:
The "LinkAssemblies" task failed unexpectedly.
Mono.Cecil.ResolutionException: Failed to resolve Android.App.Fragment
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.MarkStep.Initialize()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
I found a lot of similar problems (1, 2, 3) and the only proposed solution was to disable linker which is not the case for my app.
How can I diagnose and fix the issue?
TIA!
Are you referencing Mono.Android.Support.v4 classes everywhere?
I've been struggling with the same issue on and off for a while now. Currently, I have had success in switching to the Alpha channel of Xamarin Updates and using the alpha builds of Xamarin.Android and Xamarin Studio. Running those alphas, I have been able to make release builds with Linking enabled with no issues. Hope that helps!
Eventually GooglePlayServices Xamarin Component has been updated to 12.0.1 and not it could used without any errors even with "SDK Only" linker flag. You can use it right from component store without any bindings pre-compilation.

TypeScript 'var' is undefined error

I built a console app to find all the *.ts files in my project and then compile them using tsc.exe.
Everything was working fine, but as I converted my JavaScript files to TypeScript, I eventually ran into the following error:
ytsc.js(21053, 17) Microsoft JScipt runtime error: 'window' is undefined
Each time this happened when I was trying to extend window:
window['prop'] = "something";
I tested the code until I found the answer, which had little to do with my code...
The fault was my build tool.
I had declared the -e (execute) command line option when calling tsc.exe:
I did this because I thought I might add some automated testing code in the modules.
The cause for the error:
Most of my code is in functions.
However, there were a few places that I wanted to extend 'window' (for example if a built in function is missing from an old browser, I was shimming those calls). The code to shim the window object was running as the file loaded:
if (window.fun == null) {
window.fun = function(){...};
}
Anyway, because of the -e option, the tsc.exe was attempting to run the code (outside of a browser environment). This caused the above error.