NoClassDefFoundError while preverify the jar files in BlackBerry - blackberry

I have also asked this question on the BlackBerry support forums, under the thread "NoClassDefFoundError while preverify the jar files in BlackBerry"
I am adding a library files(jar files) in my BlackBerry Project and and try to run it. But it is giving me the below error : Error!: Missing stack map at label 77. So i try to find out the issue and find this link: Preverify Link
So i tried to fix this issue using preverifier. As i am using BlackBerry eclipse plugin, i have tried in this way:
Copy the jar file in the bin folder of my eclipse 6.0 plugins (eclipse-SDK-3.5.2-win32\eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29\components\bin)
Execute the following command in the command line:
preverify -classpath "<path to 6.0.0.29 SDK>\net_rim_api.jar" "ArcotOTP-Lib-Java-Test-2.0.0.jar"
But after running this line, i am getting the below error:
Error preverifying class Mypackage.API$1
java/lang/NoClassDefFoundError: Mypackage/Test

BlackBerry devices are running on the Java-ME platform, so you can't use modern java features. Typical Java jar files these days use newer features that are not backward compatible with the Java-ME platform. Some projects do go out of the way to be backward compatible, like Bouncy Castle. But that is rare.
This question, duplicated on the BlackBerry forums, was also answered on the BlackBerry forums, which I will capture here:
simon_hain:
and is it a j2me library?
Arindam Mukherjee:
No it is java library..all classes are basically java classes. The same library i am using for android also and it is working fine fro me..
simon_hain:
BlackBerry uses J2ME as a base, Android uses J2SE.
You cannot use an Android library on BlackBerry unless you re-compile it (and resolve all the errors due to missing reflection, lists etc)

Related

Qt for iOS: Error unknown module(s) in Qt: webkitwidgets

I have downloaded .dmg file for Qt on Android and iOS. I have installed it and tried to run examples. I am able to run examples under folder "widgets" for iOS but when I try to run example for "webkitwidgets" and run qmake on (let say for example of "browser") .pro (in this case for example browser.pro) then it gives me error : "Error unknown module(s) in Qt: webkitwidgets". Then I checked "ios" folder in installed qt directory. I found in "Include" folder there is no folder called "QtWebkitWidgets" while there is folder "QtWidgets". Let me know solution asap because I am doing some poc on Qt for iOS and need to have conclusion soon. Did I miss some steps while installation or do I have to do some extra steps to execute examples for QtWebkitWidgets. Let me know whether QtWebkitWidgets module is supported for in Qt for iOS or not. Note that I am using Qt 5.2 with XCode 5. If more detail is required then let me know.
Apple explicitly forbids that any programming language be compiled/interpreted on the iOS device itself, except by their own WebKit. So Qt’s WebKit is disallowed.
It is worthy to note thet part of the QtWebKit team has started the project QtWebEngine to explore the option of providing a Chromium/Blink based web engine instead of QtWebKit, and in addition to that, the iOS port of Qt will need their own webview API since Apple does not allow additional web engines on their iOS devices.

Unable to use System.XML.Linq

I am working on a project using Mono for Android. After reading a cross-platform document with Xamarin. I had my data layer in a separate project and was going to move it to my Mono for Android project and then link those files to my Mono Touch project, and one day perhaps a Windows Phone 8 project.
When I moved the code, I am now unable to compile because of the System.Xml.Linq reference. The reference shows in the Mono for Android project, but I am unable to use it. I thought aiming for Froyo may be the problem, but upgrading the project to Gingerbread or Ice Cream Sandwich didn't help.
Does anybody know what I am doing wrong? I am a seasoned .NET developer and am well aware of how references work in project, but this one has me stumped.
The project the original code was working on was targeting the Mono/.NET 4 framework
Is your reference to System.Xml.Linq pointing to the .Net version or the Mono version? The one for Mono will have Version 2.0.5.0.
Also, is the reference to System.Xml.Linq in a Android Class Library/Application or in a regular .Net Class library. If it is a .Net Class library, I would try referencing the library in your Android application as a compiled (dll) reference and not a project reference. It is not a perfect solution, but I have found that this works when I needed to reference libraries that I use across multiple solutions. The reference will generally work out fine, but if there is anything that is not supported in the Mono version, then it can cause issues.
Assuming you have your code in a class library, your best bet may be to create a Mono specific version of your library project. You can import and use the same class files, but just add some Conditional compilation symbols to have it compile properly for Mono. If you are not familiar with this, take a look at how Json.Net or ServiceStack manages code for multiple platforms.

In Blackberry package javax.microedition.amms.* prob

I am developing a QR code scanning application using Zxing library in Blackberry JDE 4.6. For that I have used different package in packages of javax.microedition.amms.* . Suddenly that imports are working fine, suddenly it failed to import any package javax.microedition.amms.* and starting to throwing problem. What is probable cause of this prob? I have already tried to repair the the JDE by the installer. But it does not help anything. What is way out from it?
Blackberry JDE 4.6 does not JSR-234 features. So it is not supporting javax.microedition.amms.*

Mono Android Monodroid Native Library DllNotFoundException

I am attempting to get a Native C/C++ library working with Monodroid in the emulator, using DllImport. I am developing mainly in Windows/Visual Studio 2010.
I have built a native C/C++ library (ZeroMQ) using the Android NDK tools, to both x86 and armeabi platforms, using a Ubuntu virtual machine. Is this correct - x86 for emulator and armeabi for the real device? (This is certainly the case on the iPhone/MonoTouch - though in that case statically linked libzmq.a file and DllImport __Internal)
I have added the x86 version of libzmq.so to my MonoDroid project under the directory structure lib\x86\libzmq.so
When I first attempted to build/deploy to the simulator, I got an error 'cannot determine abi type', so I've added x86 to the AndroidNativeLibrary Include="lib\x86\libzmq.so"> project item group. This then deployed.
I have a DllImport for the function to call [DllImport("libzmq"
I've tried libzmq.so, lib/x86/libzmq, lib/x86/libzmq.so etc, but then I call the DllImported method (running in the emulator), I always get a DllNotFoundException.
Can anyone give me some direction?
EDIT: After reading another support answer which states that the emulator uses armeabi .so libraries, I have removed the x86/libzmq and added my lib/armeabi/libzmq.so as an AndroidNativeLibrary. I also removed the project file Abi entry, and indeed the project built and deployed fine.
However, I still get a DllNotFoundException when I try to call a DllImported function. Any ideas?
Many thanks
I don't have any immediate ideas why it isn't working for you; [DllImport("zmq")] should work.
The SanityTests sample exercises the DllImport attribute.
The DllImport: https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/Hello.cs#L240
The Android.mk to build libfoo.so: https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/jni/Android.mk
Building libfoo.so by calling ndk-build: https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/SanityTests.csproj#L82
Including libfoo.so into the .apk: https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/SanityTests.csproj#L96
(This is a repeat of my reply to your email in the ZeroMQ mailing list).
This error could be caused by using an incorrect platform target in your Mono project. I'm not sure if Mono/MonoDevelop supports this, but you probably need to create an ARM platform target, as opposed to x86/x64/Any CPU.
You would experience the same errors if you tried to do P/Invoke interop between an x64-targeted assembly with an x86 native library or vice-versa.
If you're using the clrzmq bindings for bridging Mono and libzmq, you will need to create a new platform target for ARM and rebuild the bindings. The solution only defines x86 and x64 platform targets currently.
Ok, I finally got it working! For whatever reason, ZeroMQ doesn't build correctly using the current/latest NDK r7. The instructions at http://www.zeromq.org/build:android use NDK r6. I also downloaded an old version of the NDK r5b (it was the easiest old version to find a download for), and rebuilt ZeroMQ using it. Result, it now works on emulator and phone!

Unable to Create a Database in Blackberry eclipse

I am trying to create a database in blackberry eclipse with jde plugins. I am using Eclipse IDE v.3.4 and pluging v. 1.1 . I have also downloaded an SqLite demo project to understand it. I have searched many sites and tried to run a sample program by copying the code, but it doesn't work. It shows a problem with the following lines:
import net.rim.device.api.database.*;
import net.rim.device.api.database.Database;
import net.rim.device.api.database.DatabaseException;
import net.rim.device.api.database.DataTypeException;
import net.rim.device.api.database.Row;
import net.rim.device.api.database.Statement;
I am not getting the following things:
1) Do I have to make the net.rim.device.api.database package myself?
2) How do I create, update and retrieve information at runtime?
From the sounds of it, I'm not sure that you are building your application with the BB JRE.
How did you create your project in Eclipse?
In your package view, there will be a line that shows something either like Blackberry JRE 5.0.0 or Blackberry JRE 4.5.0 or possibly JDK 6
In order to access your rims, you need to have the BB JRE 5.0 (or 6.0 since it came out yesterday) in your project's build path.

Resources