Codename One iOS build error: Implicit declaration of function 'java_lang_NullPointerException___INIT___' is invalid in C99
-
02-01-2020 - |
Question
I'm trying to build the iOS source code generated by the CodeName One build server. I specifically upgraded to the Basic account to have this feature.
I'm experiencing build errors on XCode 5.1.1 which are similar to this one:
/build/xcode/src/app/java_lang_NoSuchFieldError.m:227:5: Implicit
declaration of function 'java_lang_NullPointerException___INIT___' is invalid in C99
This is what I did:
- Take a functioning CodenameOne app (mine didn't work so I also tried with KitchenSink with similar results)
- I followed the steps from the guide in the how-do-i section
- load the xcode project from dist
- added everything from res
- added selectively from btres: *.xib, *.a, *.res, *.strings
- Additionally I had to change the architecture in: build settings / architectures / standard architectures
After that I hit the error above. The obvious solution is to declare functions before use, per the restrictions of the C99 language standard, but after including the required headers a few times I gave up.
The way I see it, this could happen because something else needs to be adjusted in the xcode project (I'm not too familiar with iOS development). Also it could be a code generation bug.
Any thoughts?
Solution
Use xcode 5.0 and not 5.1 which only works with the new VM. You can download older versions from Apples developer site.