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 related to ARC. After Google I found that updating to a version of J2Objc to 1.0.1 will fix it and I updated version. Files are compiling successfully but at on step of archive it is failing with error: Static library archiver failed while archiving liborg.apache.commons-commons-math3-j2objc.a
I followed steps from here: http://dabugger.blogspot.com/2015/03/java-to-objective-c-journey.html
Here is detailed logs: https://gist.github.com/iducool/ef1531302171c1e59fe988ce5e20d37b
It would be really helpful if somebody can tell me correct or appropriate steps or point out to the cause or solution of this issue. I am also happy to hear alternatives of this library if any[I have already searched but not found anything].
Update:
Instead of Graddle plugin I started to use J2Objc using XCode build rules. I have downloaded J2Objc and there is a sample of "Hello" which is capable of running simple Jave file. I tried that and it is working fine.
I have added Apache math library into same project(to save time from doing settings and run into errors) and updated source path into BuileRules script. XCode is considering java files and try to compile that but it is showing error of package in that library.
Getting so many errors which are complaining about the package not found Here is one example of it:
error: /Users/myUser/Documents/j2objc-2.4/examples/Hello/Hello/java/org/apache/commons/math3/util/Precision.java:22:
package org.apache.commons.math3.exception does not exist
Update-1
Using below command:
./j2objc --build-closure -g -d ./gjava -sourcepath /Users/myUser/Downloads/commons-math3-3.6.1-src/src/main/java `find /Users/myUser/Downloads/commons-math3-3.6.1-src/src/main/java -name '*.java'`
I am able to generate Objective-C classes. But those classes are giving errors in almost all imports which has path like,
#include "org/apache/commons/math3/FieldElement.h"
Error :
'org/apache/commons/math3/FieldElement.h' file not found
All compile-time errors are resolved. Trying to use classes and see if it is working. I will post the answer in some time.