Questions tagged [j2objc]

J2ObjC is an open-source command-line tool from Google that translates Java code to Objective-C for the iOS (iPhone/iPad) platform.

J2ObjC is an open-source command-line tool from Google that translates Java code to Objective-C for the iOS (iPhone/iPad) platform.

137 questions
3
votes
2 answers

Does j2objc really support reflection?

I'm trying to use j2objc to translate some Java code. Unfortunately, my code relies on reflection. The j2objc documentation claims that reflection is supported, but when I try to import e.g java.lang.reflect.Field, I get an error message saying it…
user1432855
2
votes
2 answers

Compile Apache common math for iOS or alternatives

I am trying to compile Apache math for iOS. I am using this fork : https://github.com/j2objc-contrib/j2objc-common-libs-e2e-test This library is using J2Objc version : 0.9.8 and J2Objc-Graddle plugin is also old and it was throwing an error…
Iducool
  • 3,543
  • 2
  • 24
  • 45
2
votes
2 answers

How to Import Java Library and use It In my IOS(Swift) Project, Xcode 9

We have a Common Java Library for to be use in both Android and IOS .. In Android It Is common But When It Comes to IOS is there any way to use Java Library In my project.. Please help If you have any Ideas.
user6644763
2
votes
1 answer

j2objc Unable to call method that returns JavaIoInputStream in swift

One of my java classes implements 2 methods: public OutputStream getOutputStream(){ return null; } public int getV(){ return 3; } After conversion with j2Objc, I try to call those methods in swift: func test() { let i =…
Julien
  • 846
  • 1
  • 7
  • 19
2
votes
1 answer

j2objc /usr/local/lib//libprotobuf.a(strutil.o) ld: 55 duplicate symbols for architecture x86_64

I am unable to get beyond the make protobuf step due to the error below. I read up some blogs, they recommended installing brew install protobuf. Did that. Still not able to build. I am building on a Mac 10.11.6 make protobuf_dist c++ -MD -c -o…
Siddharth
  • 9,349
  • 16
  • 86
  • 148
2
votes
1 answer

"library not found for -lPods-TARGET-j2objc-shared" error for j2objc-gradle plugin

I have a simple shared project with a couple of Pojos After running the gradle tasks: ./gradlew clean build j2objcXcode and running pod install in my iOS app I get the below error when running the app in xcode: ld: library not found for…
metters_nz
  • 23
  • 3
2
votes
1 answer

j2objc Xcode build rules, not recognizing imports

I am using j2objc to compile and use a java library in iOS. I followed the processes: http://j2objc.org/docs/Xcode-Build-Rules.html http://j2objc.org/docs/Required-Link-Flags.html I do not get any build errors until I start importing the header…
XaviGG
  • 171
  • 2
  • 19
2
votes
1 answer

Mapping of primitive data type from Java to objective-C using j2objc

I am translating a big project from Java to objective-C. When there are primitive data types, they will be translated to JNI Types instead of objective-C data types, such as boolean -> jboolean. However, it is written in the documentation that the…
insyncim64
  • 125
  • 1
  • 8
2
votes
2 answers

Plural forms with Java java.util.ResourceBundle

I usejava.util.ResourceBundle for i18n like this: try { resourceBundle = ResourceBundle.getBundle("Messages", locale); } catch (MissingResourceException ex) { logger.log(Level.SEVERE, ex.getMessage(), ex); } String localizedString =…
Michael
  • 32,527
  • 49
  • 210
  • 370
2
votes
2 answers

JSON <=> Java Object Mapper which translates well with J2objc

I use the org.json.* classes which are part of the j2objc distribution. The mapping of my DTO classes and the JSON Objects are made by hand so far. I know there is GSOn and Jackson. Is there a JSON to Object Mapper library which translates well…
Michael
  • 32,527
  • 49
  • 210
  • 370
2
votes
5 answers

What product to use in order to develop a cross-platform mobile application?

I am an Android programmer developing a simple mobile app (very similar to a regular messenger). I use a client-server architecture. Server is written in Java and runs on Google App Engine. Native Android client makes HTTP requests to server, and…
naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
2
votes
1 answer

Using j2objc throws errors "Class cannot be resolved to a type"

I am using j2objc. I have 2 classes: LabelPosition.java Event.java In Event I have references to LabelPostion I could translate the standalone Class Labelposition without problems. Packagestructure and the File .h & -m are created. Now I try to…
mcfly soft
  • 11,289
  • 26
  • 98
  • 202
2
votes
1 answer

Design Pattern for J2Objc Type Projects

j2objc is great to develop shared projects across iOS, Android and Web. For me it seems to be clear that it is a good practice to create four projects: shared code web ios android Also the MVP seems to be reasonable for these kind of projects.…
Michael
  • 32,527
  • 49
  • 210
  • 370
2
votes
2 answers

NSUrlConnection synchronous request without following redirections

Problem I need to execute a synchronous HTTP request, without following redirects, preferably without using instance variables, since this is to be incorporated into the j2objc project. What have I tried I have tried using NSURLConnection…
2
votes
2 answers

J2objc add .o files to Xcode

How to add the j2objc generated .o files in xcode? I'm having Apple Mach-O Linker Errors when compile with Xcode. my .h file has added to Xcode in build setting/header search paths/{my .m files destination}
kaneyip
  • 1,237
  • 1
  • 17
  • 21
1
2
3
9 10