BlackBerry on-device debugging does not show string values - blackberry

On simple button click in BlackBerry I am writing this:
String str = "xyz";
labelField.setText(str);
When I debug the code, under the "Variables" window I cannot see value of 'str' as 'xyz' -- it is showing value of str equal to null and when I click over it, it is showing this message:
Method "toString" with signature "()Ljava/lang/String; is not applicable on this object
though the code is working fine.
What is the problem in debug mode?

Hey guys I think I have the solution for you.
Since I was having the same problem and was looking arround to find some answers (and didn't find any) I tried to just solve it by the trial-error method.
To cut the long story short: Check if you accidently have deleted your emulator *.debug files. For example I've had deleted mine (don't ask why :) ), so after I restored the whole simulator folder within the RIM JDE I've tried to debug again and voila - I could now see the values of the variables.
This is the location of the simulator folder within my BB JDE Eclipse Plugin (The standalone version that contains eclipse itself). The used BB JDE is 4.5.0 but the same folder structure is found on any JDE version.
C:\Users\GDimitrov\Documents\programs\bb_jde_plugin\plugins\net.rim.ejde.componentpack4.5.0_4.5.0.28\components\simulator
And this is the location of the simulator folder for the BB JDE 4.5.0 installed additionally through the BB installer.
C:\Program Files (x86)\RIM\BlackBerry_JDE_4.5.0\simulator
Cheers

Simply add System.out.Println statement there to display message you want.

Related

Unable to locate sdkmanager.bat. Did you run Android Studio and install cmdline-tools after installing?

i was trying to make use of unreal engine 4 template for AR but i got this error. This step kinda connect android studio with unreal but i just don't work.
Ran into the same issue and fixed it by editing the SetupAndroid.bat file.
Example of adjusted code
Not sure why it doesnt set the location of the SDKManager after it fails the first one. But manually replacing the first location works.
if you encountered this issue when running "SetupAndroid.bat", the reason might be simple. If you check the "SetupAndroid.bat"(right click, edit. Or turn it into a txt), the default sdkmanager path might be different from the actual location.
You might need to search "sdkmanager" from the Android Studio SDK root folder manually(it suppose to display on the cmd interface), find the actual directory and correct the "SetupAndroid.bat", then try it again.
the same here, i tried to search "sdkmanager" at both of my Drive and couldn't find any.
couldn't find any cmdline-tools drive as well.
Try next:
Go to your AppData\Local\Android\Sdk folder
Search for sdkmanager.bat
Navigate to its location and copy it
Open SetupAndroid.bat with Notepad (or other editor of your choice)
Find the line(s) which contains sdkmanager.bat
Paste the copied location (for example \cmdline-tools\latest\bin\sdkmanager.bat)
Save, exit, and run the edited file
This worked for me.
I spent 2 hours to figure out what's wrong with it.
So, provided earlier solutions should fix it:
Simply just replace incorrect path to correct one or, just DELETE most outer IF block and first line where %SDKMANAGER% var first set to invalid (I suppose, outdated path) value.
This is a part of the source code of SetupAndroid.bat from Epic Games. I've checked version 4.27 and 5.1. These lines are kind of identical in both versions (however version 5.1 still has the same exact error, but it works due to changing the order of which path is tried first):
set SDKMANAGER=%STUDIO_SDK_PATH%\tools\bin\sdkmanager.bat
IF EXIST "%SDKMANAGER%" (
echo Using sdkmanager: %SDKMANAGER%
) ELSE (
set SDKMANAGER=%STUDIO_SDK_PATH%\cmdline-tools\latest\bin\sdkmanager.bat
IF EXIST "%SDKMANAGER%" (
echo Using sdkmanager: %SDKMANAGER%
) ELSE (
echo Unable to locate sdkmanager.bat. Did you run Android Studio and install cmdline-tools after installing?
pause
exit /b 1
)
)
And this specific part does not work! I don't know why those who developed that did not check it or they simply don't know how batch file variables work.
The thing here is that on recent Android SDK installations there's no folder tools at the path %STUDIO_SDK_PATH%. So the first condition check fails and then they try to overwrite variable value to correct one with path %STUDIO_SDK_PATH%\cmdline-tools\latest\bin. But this overwrite DOES NOT WORK. You can't just do that in a batch file (which is kind of stupid, but it is). More on that issue with batch vars here: How to overwrite an existing variable using another variable in batch files?
"Good" job! Epic Games

Outlaw setting Corona SDK wierd issue with addressing

So this is the problem I have with my Outlaw:
My Corona SDK is in that adress:
C:\Program Files (x86)\Corona Labs\Corona SDK\Corona Simulator.exe
I'm going to Preferences --> Corona SDK simulator --> puts this adress.
once I'm trying to lunch my program, Outlaw says this:
"Windows cannot find 'C:\Program\". make sure you typed the name correctly, and then try again"
I've figures it doesn't recognise spaces (lamest thing ever). what the hell should I do? I don't want to mobilize my entire computer to non-spaced folders.
I've stumbled to the same problem trying to use Outlaw on Windows. I've tried adding quotes, tried options with PATH, but ultimately I've to just gave up.
Apparently author never tested his app under Windows :)
As a side note I can recommend ZeroBrane Studio as an excellent alternative. It's free and works great with Corona.
You need to use the Browse button in Prefs to point to the simulator exe; don't type in the pathname. I should probably make that field read-only so you have to use the Browse button.

"No SDK found at specified location" error in Monodevelop

I installed Mac OS X version 10.8.2.
After that, I either installed Monodevelop first or XCode first. But when I got this error, I deleted both. Then, installed XCode 4.5.2 and then installed MonoDevelop again, but it was using an older SDK.
So I copied the iPhoneOS6.0.sdk from the
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
folder and put it into a separate folder on my machine
/SDKs/
Then I set the path in MonoDevelop to use the SDK as found in /SDKs folder. But I am still getting this error-
"No SDK found at specified location"
This is very frustrating. What am I doing wrong?
None of this should be required. MonoDevelop should automatically find the SDK.
Try leaving the SDK location empty so MD will say "using default location".
If you want to point it to a specific SDK, let it point to the Xcode.app file. An app file is nothing but a folder. MonoDevelop will find the SDK in there. No need to copy anything.
First do not copy files/directory around. Mostly because this is not needed but also because you might break your installation(s) and get hard to diagnose bugs.
MonoDevelop's Apple SDK location (in the preferences) must point to the Xcode.app, which by default, is /Applications/Xcode.app (that's where MonoDevelop will look for if nothing is specified).
You can point it elsewhere, e.g. /Volumes/Xcode/XcodeXX-DPX.app if you want to mount a disk image with a specific version of Xcode.
Notes:
when MonoDevelop finds what's it's looking for then you'll get a green checkmark (so you know it's properly configured);
you might have to run Xcode first so it will install it's command-line tools and device support libraries. Without them it's possible the the builds/installation will fail (but with a different error message than the one you mentioned)

Mono For Android Hello World code throws AndroidManifest.xml error

I recently downloaded the trial version of Mono For Android. I tried running the Hello World tutorial. I receive the following error:
Tried to launch activity 'HelloMonoDroid.HelloMonoDroid/hellomonodroid.Activity1', but the device could not find it.
A common cause of this is manually adding an to your AndroidManifest.xml whose name does not match your Activity class.
Consider using the [Activity] attribute instead:
http://monodroid.net/Tutorials/Working_with_AndroidManifest.xml
I triple checked my code and didn't see any differences between it and the posted code in the tutorial. So I tried to create a new Mono For Android Project and ran it without modification. I named the Project Driver. Here is the error I received:
Tried to launch activity 'Driver.Driver/driver.Activity1', but the device could not find it.
A common cause of this is manually adding an to your AndroidManifest.xml whose name does not match your Activity class.
Consider using the [Activity] attribute instead:
http://monodroid.net/Tutorials/Working_with_AndroidManifest.xml
Notice it is the same as the original error with only the activity name changed. This is a simple solution. I am not creating a AndroidManifest.xml file manually. Is this a bug with the Mono For Android product?
Go to Tools->Options->Mono for Android and turn on adb logging.
This should write a log to your desktop that might give more details.
Aha, thanks I've found the issue. There is a place in that dialog (Tools->Options->Mono For Android) that sets the Android SDK path. After doing this the solution deploys and works with no trouble. I thought I told the installer where the SDK was, but apparently not. Its possible I got myself confused as I'm evaluating the Eclipse/Android SDK development environment in parrallel.

Application not getting deployed on Blackberry simulator

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.

Resources