Error #3671: Buffer has zero size - actionscript-3

I wonder why I got this error on another canvas? While I was using larger canvas for another object, it doesn't has any problem. But on another object, I got this error and the numVertices is null or 0.
It happen when I lock the screen then unlock it back. Like on desktop is ctrl + alt + del and on device is press the lock button.
I am using starling Framwork Ver 1.7 the newest on Github, flex SDK ver 4.6.0, and AIR 18.0
Here where I got the error :
flash.display3D::Context3D/createVertexBuffer
starling.display::Canvas/syncBuffers at D:\Project\starling 1.7src\starling\display\Canvas.as:237
starling.display::Canvas/onContextCreated at D:\Project\starling 1.7src\starling\display\Canvas.as:71
starling.events::EventDispatcher/invokeEvent at D:\Project\starling 1.7 src\starling\events\EventDispatcher.as:146
starling.events::EventDispatcher/dispatchEvent at D:\Project\starling 1.7 src\starling\events\EventDispatcher.as:117
starling.events::EventDispatcher/dispatchEventWith at D:\Project\starling 1.7 src\starling\events\EventDispatcher.as:195
starling.core::Starling/initializeGraphicsAPI at D:\Project\starling 1.7 src\starling\core\Starling.as:451
starling.core::Starling/initialize at D:\Project\starling 1.7 src\starling\core\Starling.as:434
starling.core::Starling/onContextCreated at D:\Project\starling 1.7 src\starling\core\Starling.as:691

maybe my canvas has zero width and height. because i just initialize it and haven't use yet. i just add this command and all done.
myCanvas.drawRectangle(0,0,1,1);
so my canvas has width and height. you can also try another draw, like polygon, circle or ellipse.

Related

AFNetworking Lexical or preprocessor issue Expected ':'

I downloaded the latest AFNetworking framework 2.5 and tried out the example project. However, my build has failed with the following error in AFNetworkReachabilityManager.h, AFURLConnectionOperation.h, AFHTTPRequestOperationManager.h.
Lexical or Preprocessor Issue Expected ':'
Can anyone help why this error occurs? How to resolve it? I am using xcode 5.1.1 with IOS 7.0 sdk.
Thanks a lot in advance.
For AFNetworking version greater than 2.0 minimum iOS target is iOS 6 and minimum OS X target is OX X 10.8. so just update to the minimum requirement and you would be able to resolve the error as it was in my case.
For requirement of AFNetworking just go through this link :
https://github.com/AFNetworking/AFNetworking#requirements

PIE disabled. Absolute addressing not allowed in code signed PIE

I'm working with Xcode 4.5 with a deployment target of iOS 5.1
I'm getting the following warning when I compile my app in relation to two specific methods which have significantly increased in size.
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in -[mfile method]. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
And subsequently the app is throwing an exception at launch with the following error:
dyld: vm_protect(0x00001000, 0x0078C000, false, 0x07) failed, result=2 for segment __TEXT in /var/mobile/Applications/8E764612-87ED-4A99-9C59-E56C934DA997/appname.app/appname
dyld dyld_fatal_error:
0x2feb20c4: trap
0x2feb20c8: nop
When I comment out the methods in question, the app runs fine.
Any suggestions?
Here is a response from the Unity forums:
In xcode 4.6 build settings change "Dont create position independent executables" from NO to Yes, thats it.
Credits go to amit-chai

JPEGEncoderOptions is undefined

I get a runtime error that JPEGEncoderOptions is an undefined variable when running the below code in AIR 3.5:
rawBitmapData.encode(rawBitmapData.rect, new JPEGEncoderOptions(), rawByteArray);
Make sure the following files in your sdk are up-to-date in the folder \yoursdk\frameworks\
air-config.xml
flex-config.xml
airmobile-config.xml
Update this:
<target-player>11.5</target-player>
<swf-version>18</swf-version>
This ensures your runtime is up-to-date
See : Use Adobe Air 3.3 SDK with Flash Builder
You may be missing an import of the flash.display.JPEGEncoderOptions package, or you may fully quality the package inline as below.
Example from Adobe Flash Platform Compressing bitmap data:
// Compress a BitmapData object as a JPEG file.
var bitmapData:BitmapData = new BitmapData(640,480,false,0x00FF00);
var byteArray:ByteArray = new ByteArray();
bitmapData.encode(new Rectangle(0,0,640,480), new flash.display.JPEGEncoderOptions(), byteArray);
If you get a runtime error, it can't be a missing import. You must be running it in a Flash Player that's too old, or an AIR runtime that's too old.
I've tested PNG encoding a while back and did this:
var bitmapData:BitmapData = yourBitmapDataHere;
if("encode" in bitmapData)
{
// use the native encode method
png = bitmapData.encode(bitmapData.rect, new PNGEncoderOptions(false));
}
else
{
// use old png encoder (from AS3CoreLib)
png = PNGEncoder.encode(bitmapData);
}
This effectively tests if your player or runtime environment supports BitmapData's .encode() method. If that test fails, you must be using a player that's too old.
Are you definitely including the class at the top of your code?
You need the latest Flex SDK to compile that, because those classes were only introduced in Flash Player 11.3. Flex SDK 4.6 worked for me, while Flex SDK 4.5 and lower gave me the same compiler error.
If its a runtime error, then you are running the content in a lower AIR version, or in a lower Flash Player version. Use the following method to fallback to normal code if the class is not present in the FP version you are running in. Useful for web content.
try {
// use FP 11.3 encoding
var options:Object = new JPEGEncoderOptions(quality);
var bytes:ByteArray = new ByteArray();
bitmap.encode(bitmap.rect, options, bytes);
} catch (e:Error){
// use manual JPEG encoding
}
It may be that you are missing a playerglobal for the version you are targeting or it's an incorrect playerglobal.swc in the SDK's player directory.
Download the latest Apache Flex SDK and switch to that if you can and try to create an instance of the class in a new project or your main application.
Honestly, I think it was a bug in the compiler or playerglobal. When I looked at the sdk folders I think that the playerglobal.swc might have been incorrect (all versions are named playerglobal.swc) OR it might have been the fact that I only had one directory in the SDK I was using and it had an "/11.2/playerglobal.swc" but no other folders. I think I would have needed a directory called "/11.5/playerglobal.swc" to have -swf-version make any difference.
It would be nice if the compiler threw an error when the playerglobal for the swf-version was not found at compile time. Go into the SDK folder and download and add the playerglobals to the SDK directory for the minimum targeted player to use this class.
In my Flex 4.6.0 SDK player directory, "$Flash Builder/sdks/4.6.0/frameworks/libs/player/" the swcs in:
11.1 dated 10/30/2012 351kb
11.2 dated 01/27/2013 352kb
11.5 dated 11/23/2014 351kb
11.6 dated 01/27/2013 352kb
15.0 dated 11/20/2014 388kb
In the Apache Flex 4.14RC install is:
11.1 dated 10/30/2012 351kb
11.2 dated 01/27/2013 352kb
11.5 dated 11/23/2014 351kb
11.6 dated 01/27/2013 352kb
15.0 dated 01/12/2015 388kb
It's possible something was installed somewhere along the way that is out of sync.

Why does cuCtxCreate return old context?

i have installed:
CUDA sdk 4.2 64,
CUDA toolkit 4.2 64,
CUDA devdriver 4.2 64,
I checked every nvcuda.dll in \windows - all of them, are 4.2 version, but when i create a context with driver api and check it verison with cuCtxGetApiVersion - it shows me "3010"
I do not really care about that version, but when i try to use runtime api with that context(need to mix them) - it shows me error 49(cudaErrorIncompatibleDriverContext)
any ideas, what is going on and how to make it work together?
seems it is not some issue with windows - running the same project under linux results in the same 3010 API version.
I solved the problem - i was exporting "cuCtxCreate" function directly during execution(it is other language - no cuda.h). After looking in original cuda.h i found that it defines other name for that functrion, basing on some sort of smartass defines.
And that new function "cuCtxCreate_v2" creates a good context.
/facepalm

difference in Flex 4.5 & flex 4.5.1, air 2.5 and air 2.7

import spark.components.supportClasses.MobileTextField;
in my Flash Builder 4.5 there is a error: it can't find the MobileTextField class in the park.components.supportClasses. i think it is in flex4.5 sdk and air 2.5.
so i want to know how to do it in flex4.5.1 sdk.
That was a beta class and it didn't make the cut.
http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/spark/components/supportClasses/MobileTextField.html
Although, you should be able to just use a TextField. Is there some specific functionality you were needing?
you can also use the property MobileTextField as
MobileTextField(txtMyText.textDisplay).htmlText = "sample <b>text</b>";
and it works. Just needed to import:
import spark.components.supportClasses.MobileTextField;
to get it working.