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

"Object can not be resolved to a type"

I'm trying to convert some of my Android project logic files into objectiveC code with j2objc tool. I get a lot of type errors with my actual project, so I'm trying to convert at least helloworld, e.g.: public class Test { public static void…
Mikhail Krutov
  • 670
  • 1
  • 5
  • 29
0
votes
1 answer

J2Ojbc native compile- guava headers missing

We are porting an iOS application to Android and are exploring J2objc and protobuf. So far we are working through the issues (we're new to Android and a number of them are due to learning curve). This particular issue seems like a bug on the latest…
Gjchoza
  • 187
  • 1
  • 7
0
votes
1 answer

j2obj translate of javanano protobuf fails to compile

I'm relatively new to Android and j2objc, hoping this issue has a simple fix. I created a simple project to test protobuf nano in Android and translate to objective c. The app runs fine in Java sending messages to a C# web service but the…
Gjchoza
  • 187
  • 1
  • 7
0
votes
1 answer

Really really a beginner to J2objc

Thank you for your time. I am completely lost on how to setup and actually USE j2objc. The "getting started" portion of the website, explains absolutely nothing to someone like me. and by "like me"...I mean...someone who has never even opened an…
0
votes
1 answer

J2Objc: Not able to initialize an object through Swift using generated code

I have in my Bridging-Header.h: #ifndef EXAMPLE_HEADER_H #define EXAMPLE_HEADER_H #import "com/example/MyObject.h" #endif The Swift Compiler - Code Generation also has been updated to have a reference to this file under Build Settings. While the…
0
votes
1 answer

J2ObjC: translating @Nullable to __nullable

I'm trying to translate Java nullability annotations to Objective-C to get Optionals in Swift but nothing happens, the signature of the methods remains the same. Here is the Java code: import javax.annotation.Nullable; import…
emenegro
  • 6,901
  • 10
  • 45
  • 68
0
votes
2 answers

Generate with public instead of private members with j2objc

I've recently update j2objc from 0.9.4 to the latest version (0.9.8.2.1). Previous version generates all members as public, but since 0.9.6 private members are hidden by default. For some reasons I have to have access to some private members from…
Accid Bright
  • 592
  • 5
  • 17
0
votes
1 answer

j2objc not honoring dead code report

I am attempting to get j2objc to run on a few of my java only modules in a gradle project. I am using the gradle plugin for j2objc but I don't believe that is the source of any problems. The module uses XMLUnit to detect differences in input files.…
Jared
  • 1,449
  • 2
  • 19
  • 40
0
votes
1 answer

j2objc object serialization -- java.lang.NoSuchMethodException: writeReplace

Update - You can find a sample project to recreate the issue here: https://github.com/benf1977/j2objc-serialization-example/releases/tag/1.0 I'm trying to serialize an object in Java and pass the bytes over to my Objective-C layer to write to the…
Ben Flynn
  • 18,524
  • 20
  • 97
  • 142
0
votes
1 answer

j2objc Error in Translate to Objective C

there is Android Source I Need to translate to Objective C but it shows error : java -Xbootclasspath:$J2OBJC_HOME/lib/jre_emul.jar -jar $J2OBJC_HOME/lib/j2objc.jar j2objcc Invalid layout of java.lang.String at value # # A fatal error has been…
Hossein Kurd
  • 3,184
  • 3
  • 41
  • 71
0
votes
1 answer

Interface parameters that are inlined in java with j2objc

I have a method in my Java Model that is called like this: httpClient.login(email, password, new JsonResponseHandler() { @Override public void onSuccess(int statusCode, JsonObject response) { } @Override …
ph1lb4
  • 1,982
  • 17
  • 24
0
votes
1 answer

How to refer to gradle dependency source.jar

I want to pass the dependency-x.y.z-sources.jar that gradle downloads as a parameter to another plugin (specifically j2objc ) Is there a way to have a reference to the downloaded source jar?
OscarRyz
  • 196,001
  • 113
  • 385
  • 569
0
votes
1 answer

Convert JavaUtilDate to NSDate and vice versa?

I use j2objc to translate a java util Date to a objective-c JavaUtilDate class. I imported #import "java/util/Date.h"to store a translated java Date variable. var myDate: JavaUtilDate How do I convert a JavaUtilDate into an NSDate?
Michael
  • 32,527
  • 49
  • 210
  • 370
0
votes
1 answer

How are the libraries .h files included

I have successfully generated Objc .m and .h files from my simplistic Dagger-2 code. https://gist.github.com/OscarRyz/ffd976fcae9acf87dbe1 Now I'm trying to compile those file using j2objcc but the error message says it can't find .h for the the…
OscarRyz
  • 196,001
  • 113
  • 385
  • 569
0
votes
1 answer

j2objc: No such file or directory

I was including the j2objc library file in objective c program. I mean I was translating the java code into objective c. But when I run, the project error occurs as j2objc: No such file or directory can someone help me with how to initialize the…
Perumal
  • 21
  • 5