Having some issues getting a release build of an Air IOS Ipad app running (starling based).
I am doing a release build, and saving the ipa file on my drive. I double click the ipa to get it into iTunes, and from there I do an app install onto the iPad.
Once on the ipad, the app fails to load any external files.
I put up a preloader, and attempt to load assets via Loadermax, however, it seems to fail.
Here is the code section that the app fails on: (NOTE: this all works in debug mode, both in Air simulator, and debug mode on device via usb)
import com.greensock.events.LoaderEvent;
import com.greensock.loading.ImageLoader;
import flash.filesystem.File;
...
...
var _imageLoader:ImageLoader;
...
...
private function loadAssets():void{
var _appFile:File = File.applicationDirectory;
_appFile = _appFile.resolvePath("assets/statics/blueImage.png");
_imageLoader = new ImageLoader(_appFile.nativePath, {onComplete:onImageLoaded, onFail:onImageLoadFail});
}
private function onImageLoaded(e:LoaderEvent):void{
traceOut("OH MY GOD BATMAN, IT WORKED!!!"); // traceOut is a helper method that prints to a textfield on the display
}
private function onImageLoadFail(e:LoaderEvent):void{
traceOut("back to the Bat Cave...");
}
...
...
In debug mode, the above code shows:
OH MY GOD BATMAN, IT WORKED!!!
In release build:
back to the Bat Cave...
Anyone know where I am going off the rails? I am not using any ANE's or such.
Based in SDK: "http://ns.adobe.com/air/application/14.0"
PCs are not case sensitive but Ios is. While in simulator or debug mode a file name "myFile" would work even if it's really "myfile" (note the cap difference) on release mode it will fail.
If that doesn't work then try using the url property of File instead of nativePath. Also you can easily check is the file exist prior to loading it:
if(_appFile.exist)
Also when depending on custom frameworks you force yourself on depending on their shortcomings. Use a classic Loader instance to repeat the same operation and see if that one succeed. You'll be surprise the number of times a custom framework can fail on simple operations simply because the way it's setup internally.
Firstly, Thank you to to the individuals who assisted in getting to the root of this problem and solving, especially BotMaster.
The issue really has to do with Flashbuilder, and a bug that is associated with it's Build Release wizard.
After reading this:
https://forums.adobe.com/message/5750011
What I did was:
click the "Export Release Build" button in Flashbuilder,
IMPORTANT: check the box for "Keep bin-release-temp folder"
Click Next
Click Cancel
Via Windows Explorer, navigated to the bin-debug folder, and copied the "assets" and "configuration" folders to the "bin-debug-temp" folder that was generated by flash-builder
I return to Flash builder, and Click on "Export Release Build" button again.
Check the box for "Keep bin-release-temp folder"
Click Next
Check the boxes beside "assets" and "configuration", Click Finish.
the newly generated ipa file had the folders I required.
Once again, thanks to those who contributed to resolve this bug.
Related
I was successfully created a signed Blackberry app. I have ever deployed it and succeed. But i wonder why somehow, when now i debug it, the app won't run and said,
Error Starting `MyApplication`: Can't find entry point
During debugging, my project doesn't show any errors, packaging works well. As far as i remember, i do not perform any significant changes on my code nor on the project description and properties, before i got this error. Anyone here ever faced the same problem?
For your info, my project has only one main method and uses SMS listener thread inside UiApplication class. I get this error both on real device and simulator. I was trying to completely uninstall the app, but coincidentally it cannot be deleted because delete menu doesn't appear.
First of all, make sure that the main method is in a publicly accessible Class, and add a breakpoint to the first line inside the method, to check that the application isn't throwing an exception and dying on your. Also try putting the whole main method into a try/catch with exception logging to get a look at what might/might not be going on.
Secondly, it is possible that the device/simulator being used just needs the previous version of the application deleting. Go to the settings and navigate to the third party installed apps, and make sure yours is removed. A reboot is required (battery pull). On simulator, navigate to the bin/simulator folder in your SDK directory and run the cleanup.bat file to reset the simulator. Then try again. You say that the delete menu doesn't appear, I assume this is on the Third party Installs screen?
A third option is to go into your application descriptor xml file, and check that there is a visible entry point, and that everything is correctly filled in.
Also try doing a refresh and clean build, and checking that all the files are correctly compiling (is there a class file created correctly in your bin folder? And has the distribution folder correctly populated with the cod/jad files for distribution?)
Another option is to re-import the project into your IDE to force the IDE to regenerate some files, and to try loading another project onto the device. If that works an option could be to copy your class files etc over to the new project.
Some of the above are a hassle, but welcome to BlackBerry development!
I've been stuck with a huge problem for a few days now and it is very frustrating. Everything was working perfectly until I messed around with target settings/provisioning a few days ago. Essentially no images are being copied from the project to be included in the app bundle.
I have:
Double checked their case consistency
Made sure they are all included in copy resource bundle section of
build phases
Performed multiple cleans and manual clean outs of the derived
data folder
And the images appear fine in the simulator.
I really don't know where else to turn or what else to try. Any help in solving this would be HUGELY appreciate as I am trying to release an update for an app but am unable to do so before getting this fixed.
ALso it is worth mentioning ever since this problem started occuring it happens in all of my xcode projects.
Check the build log. It's in the "Log Navigator" tab (press command-7). The build log graphically shows the results of the build steps.
Check the path of the individual "CopyPNGFile" steps. You can also open the textual log by clicking the far right button in each build step.
I am providing this for everyone to hopefully save you some brain damage in finding this yourself.
As I'm working on a BlackBerry project that will run on various devices I ran into an issue grabbing screenshots from the handset (including the Torch 9850 ... not quite as good as my iPhones or my Android EVO or Infuse, but much better than the Storm and finally starting to look like a real smartphone - great performance and battery life too).
Normally I'd use my trusty BBScreenShooter and everything would be fine, but it kept crashing when attempting to capture images on the 9850. I posted a couple of requests for help on this site, but nobody could tell me why my BBScreenShooter was crashing or why I'd get "Retrieving screen <active> data ... Error: buffer too small" when using RIM's JavaLoader utility directly.
For those who didn't know BBScreenShooter delegates the "heavy lifting" to JavaLoader to grab the images.
With the help of Mark Sohm (easily one of the most knowledgable BB guys I know walking the planet) he asked me to verify I was using JavaLoader that is included in the v7 SDK. Turns out I wasn't. Good catch Mark, and thanks!
From the looks of things it appears the earlier versions of the JavaLoader utility have byte[] buffers they use for image capture that are hardcoded ... and too small.
So, for all those who need to capture screen shots from RIM's new 480 x 800 based handsets I have included a quick "how to" guide to help you get productive ASAP.
Step 1 - Make sure you have the v7.0 SDK downloaded (doesn't have to be installed, though I cannot think of a good reason not to). For Eclipse users:
Step 1a) Go to the Help menu
Step 1b) Install New Software menu choice
Step 1c) Add the "BlackBerry - http://www.blackberry.com/go/eclipseUpdate/3.6/java" items in your "work with" field.
Step 1d) Under the "BlackBerry Java Plug-in Category", look for the "BlackBerry Java SDK v7.0.0.X" checkbox and click NEXT.
Step 1e) Accept the license agreements and continue the download and installation process.
Step 2 - Go to the installation directory for your newly added SDK. We're going to grab a copy of the path to the JavaLoader utility and use it within a BAT file that will automate the capture and naming of screen shots. This will be found at /plugins/net.rim.ejde.componentpack7.0.0_7.0.0.28/components/bin/JavaLoader.exe
Step 3 - Create a folder you'd like to use to save screen captures. This will also hold your BAT file as the BAT file is specific to this particular project.
Step 4 - Create the BAT file. In my example here I keep all my IDEs, SDK, ... effectively all development environments on a different hard drive than my OS. I keep these on drive D, but modify your BAT to reflect the location and needs of your configuration.
Step 4a) It's important to turn the echo off, otherwise you will probably be unable to use the icon on the desktop to launch this script/utility.
Step 4b) If your BAT file is running locally (same folder) as JavaLoader then this step will be unnecessary. On the other hand if your JavaLoader is on a different hard drive and tucked away deep in folders then you'll have to "change directory" to get to it. Notice the "/D" switch that is used with the "change directory - cd" command so that we can change drives and paths in the same step.
Step 4c) As I like to use timestamps for part of my file names ... set local variables to represent the current date and time.
step 4d) The following "for" statements parse out the current date and time from my Windows 7 computer into a format that I want to include as the file names for my screen captures ... file name == BlackBerry_<date image was taken>_<time image was taken>.bmp.
Step 4e) Copy the newly created device screen shot that JavaLoader captured to your target folder and use the file name we've just created.
Step 4f) Now that we've successfully got a copy of the screenshot saved in our desired target folder we can delete the temporary image that JavaLoader created.
Step 4g) I echo a little statement that lets me know it all worked.
Example BAT file:
#echo off
cd /D D:\Program Files (x86)\EclipseBlackBerry\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.28\components\bin
JavaLoader screenshot tempImage.bmp
set timestampdate=%date%
set timestamptime=%time%
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set timestampdate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set timestamptime=%%a%%b)
copy tempImage.bmp "C:\Users\CirrusFlyer\Desktop\<project name>\Testing\Screenshots\BlackBerry_%timestampdate%_%timestamptime%.bmp"
DEL tempImage.bmp
echo Completed "...\<project name>\Testing\Screenshots\BlackBerry_%timestampdate%_%timestamptime%.bmp"
Step 5 - Close and save your BAT file. I kept the BAT in my actual project folder, then created a shortcut and placed it on my desktop. This way I can have my Eclipse up and running and be debugging the application on my handset, and when I want to grab a screen shot simply double-click the shortcut to execute the capture.
This will create screen shots and place them in the target directory: BlackBerry_2011-10-07_1015 PM.bmp, for example.
Step 6 - Your done. Happy coding. Hope this helps.
My next project: extending Eclipse so that I can do screen captures directly from within the IDE the same way I can when doing Android based programming.
I don't know how make my application as auto start application.That is my expectation is,After simulator loads it should not open normal main screen which consist of contacts icon,message icons. it should directly run my application.
Try project->properties->BlackBerry Project Properties->Application tab->Auto-run on startup
See BlackBerryForums.com - Running a Java App on Startup
Here's another link related to the subject matter:
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800660/How_To_-_Create_an_auto-start_MIDlet.html?nodeid=1408081&vernum=0
However, it sounds like you might be expecting the simulator to work like other manufacturer simulators where the application you are working on automatically boots when the simulator starts. This doesn't happen with the BlackBerry simulator, but your app should be located in the Download folder.
To add to Max Gontar's answer, make sure that this same name is stored in the property:
BlackBerry Project Properties -> Build tab -> Output file name
And then the Debug Configuration needs to be updated with this same Output file name. By default, the debug configuration inserts the name of the project, which is not always the same as this output name.
That's the part that got me caught out (project name was copied from a different project).
So it is possible.
Through XML descriptor of any blackberry application one can set checked on auto-run on start up and select start up tier for your application.
I am tried deploying .cod,.alx.jar files on blackberry simulator 8100;the application is not getting deployed on phone.I am using Blackberry plugin for Eclipse.
How can I solve this issue?
Please help
Update
Hi,
Thanks for your reply.
I am trying to run the application the way you suggested.
Do I need to setup new run configuration every time I run any project?
What should be default value for build configuration ? [Debug,Private,or Release]
Copying the .cod files into the simulator's directory (where all the other .cod files are) and restarting the simulator will work.
Probably though you want to automatically deploy from Eclipse. If this isn't working for you, there are a couple of things to check:
Check that the project has been activated for BlackBerry - from the right-click menu for the project, make sure that Activate For BlackBerry is checked.
If that's already checked (as it is by default when you create a new BB project), then sometimes explicitly building the project will do the trick: From the Project menu, choose Build Active BlackBerry Simulation
EDIT: In response to some comments below I thought of something else. The configuration you choose may have something to do with your problems (BlackBerry -> Build Configurations). The configuration in the JDE Plug-in doesn't affect the code generated, but it does affect which projects are activated for BlackBerry. If you switch configurations, your project may become un-activated.
Since it doesn't affect the code, I usually just pick one configuration and stick with it throughout debugging and release.
You might be missing 'jar' in your PATH. If so, the eclipse BB plugin silently fails and your application won't be pushed to your simulator plugin directory. To see this failure within eclipse, choose 'Project > Build Active BlackBerry Simulation'.
If you don't have jar in your path, then you will see:
I/O Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified rapc executed for the project
So, if your JDK is here:
C:\Sun\SDK\jdk\bin
Then append it to your system environment's PATH variable, then re-run 'Build Active BlackBerry Simulation' and you should see:
rapc executed for the project [YOUR PROJECT]
Here are a couple of ideas:
1) If you have any build errors then the application won't deploy to the Simulator. The Eclipse compiler (that underlines compile errors in red) is different to the "rapc" one that creates the binary for the Simulator. I have heard of situations where the Eclipse build seems to work, but the rapc compile fails - check the Console for the detailed rapc output (this might not look like a normal Eclipse build error).
2) In the Eclipse menu, open BlackBerry -> Configure BlackBerry Workspace.
Under BlackBerry JDE choose Code Signing and make sure the three RIM checkboxes are selected. I had compile errors when these weren't selected.
Under BlackBerry JDE choose Installed Components. Choose to use the Component Package 4.7.0 as I have heard of problems with the 4.5.0 Simulator.
You should delete all these extra answers you posted, or you might get downvotes - they should be comments instead of answers.
Check if your simulator is set up to clean the file system / configuration before launching the simulator. Simulators can be set up like this. If you deactivate it, the application should not disappear.
For future readers, there is another possibility for this issue. Check your workbench project directory (folder) for a ProjectName.err file. This may provide a clue as to why your build is silently failing and thus not deploying. In my case, it was an "Error!907", a new icon I added to my project was too big. There was absolutely no other indications in Eclipse 3.4.1 that there was a problem in my build.
Just ran through the same kind of problem : project compiled fine but didn't deploy on any device or on any simulator, even though the debugger said it was attached !
The problem came from a .zip file that was located in the ./src directory of the project, deleting or moving it somewhere else resolved this case.
I wish I hadn't spend 2+ hours on such a stupid problem :/
I know this is old, but you have to do the "generate ALX" option from right clicking the project menu as well or it won't deploy, at least it doesn't for me.
I ran into the same problem again and none of answers posted here worked for me.
I played around and finally made it work. The problem was that the output file name contained a hyphen ('-'). Changing this name in the Build section of BlackBerry app descriptor did the trick.
I mean, how stupid a developer must be to slip that kind of bug. No error reported and why reject the names with hyphens in the first place? Give me back my two hours RIM "developers"!
I had the same problem. The reason was using 'ΓΌ' character in the title.
I have been facing this problem today, but with a MIDlet project. It turned out to be that I forgot to specify the "Name of main MIDlet class" in the BlackBerry Application Descriptor (BlackBerry_App_Descriptor.xml). Once I specified it the application appeared on the simulator correctly.