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
0
votes
1 answer

How do you use external build rule in Xcode (J2Objc)?

I want to use j2objc with an external build rule with Xcode, described to some extent here: https://developers.google.com/j2objc/guides/external-build-projects What I have accomplished so far: Transpile the java sources using a makefile Create an…
Thieri
  • 203
  • 1
  • 10
0
votes
1 answer

j2objc reflection support in native iOS classes

I've just updated my j2objc tool from 1.0.2 to 2.8. As far as I know there were changes in reflection starting from 1.1 version. And now code doesn't work anymore. We have IApplicationSupport.java interface. Something like this: public interface…
Accid Bright
  • 592
  • 5
  • 17
0
votes
1 answer

j2objc adding source class dependency for junit test class

I am very new to j2objc and have a question about translating junit test classes. I have a class (Foo.java) and a corresponding test class (FooTest.java). I am following steps from this link to translate the test class written in java.…
learner
  • 139
  • 1
  • 13
0
votes
1 answer

J2ObjC undefined symbols for architecture arm64

I'm trying to convert a java library to objective-c using j2objc and include the generated objc files into my XCode project. I managed to generate the objc files, but XCode gives me the following error: https://i.stack.imgur.com/QX3zF.png I used…
0
votes
2 answers

Cyclic dependency error J2OBJC archive build?

I am having cyclic dependency issues with my Ionic/iOS project using J2OBJC as a internal Xcode settings built in. I've set my build rules and settings in my ionic project as stated in the J2OBJC documentations. I have added the Library, User…
nemer
  • 66
  • 3
0
votes
1 answer

How can I access Android string resources from ObjC

I am looking for a function in ObjC to get strings from Android string resources. I have res/values/strings.xml (Android project): Something which…
0
votes
1 answer

J2ObjC with Swift - Bridging Header Imports not found when archiving

I've been using J2ObjC for a while now to share code code between Android and iOS. Every time I come to create an Archive to deploy I have trouble with imports in -Bridging-Header.h not being found. I usually fiddle with Header Search Paths and User…
Kiwi
  • 109
  • 8
0
votes
1 answer

How to install j2objc

Yesterday I ran "make dist" but compiling was more than 4 hours(I don't know, which time it could, if I didn't press stop). Today I run "make dist" again and compiling very long time again. Is it normal? I have Mac mini 2012, 10gb ram.
piller97
  • 85
  • 10
0
votes
1 answer

How to get custom http status text for ios using j2objc

I'm using HttpURLConnection.getResponseMessage() to get http status text. When the server responses with custom status text like HTTP/1.1 500 ItemNotFoundException, translated to objective c method returns standard message for status code 500 -…
CruorVult
  • 823
  • 1
  • 9
  • 17
0
votes
1 answer

Update J2ObjC library in Xcode10

I'm currently working on an app in Xcode10 which references the J2ObjC library. When trying to build the app i get the following errors. See line 486-490 in image below. I currently have j2objc version 0.9.8.2.1, but would like to update this to a…
MCSD
  • 151
  • 2
  • 12
0
votes
1 answer

J2Objc - Ignoring annotations when compiling code

I have a set of java beans that are annotated with @XmlRootElement from javax.xml.bind. When trying to import the .h files in my XCode project, I get the error 'javax/xml/bind/annotation/XmlTransient.h' file not found Preferably I would like to…
Andrei F
  • 4,205
  • 9
  • 35
  • 66
0
votes
1 answer

J2ObjC: How to get NSError from JavaIOIOException

I need to determine no internet exception when connecting to server without network. But on iOS I get IOException(On Android exception is ConnectException). The message of exception contains this error message: Error Domain=NSURLErrorDomain…
CruorVult
  • 823
  • 1
  • 9
  • 17
0
votes
1 answer

How to convert sqlite-jdbc-3.8.11.1.jar to iOS using j2objc?

I'm converting a java project to objective c (on iOS). However, when I run it, it's hitting: *** Terminating app due to uncaught exception 'JavaLangClassNotFoundException', reason: 'java.lang.ClassNotFoundException: org.sqlite.JDBC' I've…
user1872384
  • 6,886
  • 11
  • 61
  • 103
0
votes
1 answer

How to include "import" when using j2ojbc?

Hi I'm trying to convert a java project to objc. However there are still some hiccups when I'm trying to do so. error: package com.zzz.yyy.xxx does not exist import com.zzz.yyy.xxx.Test; e.g.: error: package com.google.gson does not exist import …
user1872384
  • 6,886
  • 11
  • 61
  • 103
0
votes
2 answers

Fastest possible j2objc integration

I just want to share our j2objc setup with you guys, as it took us some time to fine-tune it in one of our projects. We're currently compiling 400+ files using j2objc, have classname duplicates in packages, have to be able to debug java code in…
Kukosk
  • 2,892
  • 1
  • 27
  • 30