iOS build failing

57 views
Skip to first unread message

James Hastings

unread,
Jul 26, 2020, 11:44:06 PM7/26/20
to CodenameOne Discussions
I have a couple of apps that use the Bluetooth library that Steve just updated. I made sure to update and refresh the libs on the apps. One app was able to build and I have loaded it to the Apple store for review and release. The other app fails the build. The 2 apps I have are very similar, so I am able to compare most of the Bluetooth-related classes and there are no differences I can see that would cause any issue. Both apps built fine before the Bluetooth update and were published on the app store. Any ideas where to look? The errors look like this:
/var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build1847740663429161654xxx/dist/GDShiftLight-src/com_codename1_bluetoothle_Bluetooth.m:168:23: error: implicit declaration of function 'ca_weblite_codename1_json_JSONObject___INIT_____java_util_Map' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   
/* CustomInvoke */ca_weblite_codename1_json_JSONObject___INIT_____java_util_Map(threadStateData, SP[-1].data.o, locals[4].data.o);     SP -= 1;

I've attached the full log. I had first installed the JSON extension and refreshed libs, and then installed the bluetooth lib and refreshed. What should I look for or try?


error-12.txt.zip

Shai Almog

unread,
Jul 27, 2020, 10:37:02 PM7/27/20
to CodenameOne Discussions
I think the library added a dependency on the JSONObject cn1lib, try installing that too and see if it solves the issue.

FYI for future reference this is how I understood it from the large log.

This is the bottom of the file the error marks the specific file that failed:

The following build commands failed:
    CompileC /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build1847740663429161654xxx/dist/build/Build/Intermediates.noindex/ArchiveIntermediates/GDShiftLight/IntermediateBuildFilesPath/GDShiftLight.build/Release-iphoneos/GDShiftLight.build/Objects-normal/arm64/com_codename1_bluetoothle_Bluetooth.o /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build1847740663429161654xxx/dist/GDShiftLight-src/com_codename1_bluetoothle_Bluetooth.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Process return code is 65
Failed xcodebuild step

Searching the file for com_codename1_bluetoothle_Bluetooth leads to this:


/var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build1847740663429161654xxx/dist/GDShiftLight-src/com_codename1_bluetoothle_Bluetooth.m:168:23: error: implicit declaration of function 'ca_weblite_codename1_json_JSONObject___INIT_____java_util_Map' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    /* CustomInvoke */ca_weblite_codename1_json_JSONObject___INIT_____java_util_Map(threadStateData, SP[-1].data.o, locals[4].data.o);     SP -= 1;

And while that's a bit obtuse you can see that ca_weblite_codename1_json_JSONObject is missing. The syntax matches package name + class name.

James Hastings

unread,
Jul 28, 2020, 11:41:31 AM7/28/20
to CodenameOne Discussions
The only JSON-related extension I see in the catalog when I open settings is the CN1JSON.cn1lib, which is installed. I'll try to uninstall it and re-install it. If I recall, I need to deleted it from the lib folder and refresh libs to remove it? I'll try that and post results.

James Hastings

unread,
Aug 16, 2020, 12:51:00 AM8/16/20
to CodenameOne Discussions
This issue is now creeping into other Bluetooth projects. I have an app that was building and working fine. I changed some text on a label (nothing to do with bluetooth), and then the same build error started on this app. I changed the label back and it didn't help. I built the project from scratch and installed the JSON and Bluetooth plugins, and then copied my classes over but no change. I can get the project to build if I comment out any calls to the BluetoothLE CN1Lib that would result in that library using the JSON plugin. I think something broke in the JSON plugin or there is some weird caching issue on the build server. The errors are the same as my previously attached log. I also opened an issue on the plugin Github. This is bringing my projects to a halt, any suggestions would be most appreciated!

Steve Hannah

unread,
Aug 16, 2020, 8:16:28 AM8/16/20
to codenameone...@googlegroups.com
There was a report (https://stackoverflow.com/a/63247262/2935174)  a few weeks ago from someone else who was having some build problems with bluetooth.  He was able to resolve them by building the plugin from source:

In response to this I rebuilt the plugin and reposted it, but it's possible that there is something in my build environment that is still causing a problem.  (*Though I tested my builds on Android and iOS and they are working fine for me).

  I recommend you try to build it from source and see if it fixes the issue for you.

On Sat, Aug 15, 2020 at 9:51 PM James Hastings <jam...@fastlaneinnovations.com> wrote:
This issue is now creeping into other Bluetooth projects. I have an app that was building and working fine. I changed some text on a label (nothing to do with bluetooth), and then the same build error started on this app. I changed the label back and it didn't help. I built the project from scratch and installed the JSON and Bluetooth plugins, and then copied my classes over but no change. I can get the project to build if I comment out any calls to the BluetoothLE CN1Lib that would result in that library using the JSON plugin. I think something broke in the JSON plugin or there is some weird caching issue on the build server. The errors are the same as my previously attached log. I also opened an issue on the plugin Github. This is bringing my projects to a halt, any suggestions would be most appreciated!

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/9a36b10e-2e36-4920-8c78-f29f1687c79eo%40googlegroups.com.


--
Steve Hannah
Software Developer
Codename One

James Hastings

unread,
Aug 16, 2020, 6:54:12 PM8/16/20
to CodenameOne Discussions
I installed Netbeans and did the following:
- Create a CN1 Library project
- Copy the json.zip into the lib folder
- Right click on the lib folder and include the json.zip into the project
- Copy the src files from the Github into the project
- Copy the Native files from Github
- Copy the codenameone_library_appended file from Github
- Copy the build.xml file from Github
- Copy the BTDemo folder into the Netbeans project folder

Then I did a clean and build. The build was successful. I then:
Deleted the CN1Bluethooth CN1Lib from my app project
- Refreshed libs
- Copied my newly built from sources CN1Bluetooth.cn1lib into the lib folder of the project
- Refreshed libs
- Android build -> build successful but app crashes/locks up with black screen on startup (same as before)
- iOS debug build - > same build error as above

I'm also trying to copy an app project to Netbeans and see if uploading it from there has any effect, but I must be doing something wrong as it gives me the error below even though I've logged in through the settings UI and I definitely don't have a build in process.


Prompting for password
Building for username: (redacted)
You have a build in progress within the queue. Only one build may be active at a time
/Users/James/NetBeansProjects/OBD2Relay/build.xml:338: Login failed
BUILD FAILED
(total time: 1 second)




Shai Almog

unread,
Aug 16, 2020, 9:50:02 PM8/16/20
to CodenameOne Discussions
Check that you aren't using very old libraries (an old version of Codename One build). If this keeps happening I suggest contacting the web support who can look at your account details and see if something broke. You can also give them a link to your build error which will help track it down.

James Hastings

unread,
Aug 18, 2020, 1:38:25 AM8/18/20
to CodenameOne Discussions

Finally, I built the CN1JSON.CN1Lib from the Github sources and used it in my projects and they are now working. I should've tried this a while back, but since that library hasn't changed in 3+ years, I didn't think it would be the issue.

I'm using the CN1 extension for Bluetooth with the CN1JSON built from sources and manually copied into the libs folder (then refresh libs), and it's all working - in case anyone else is having this issue.
Reply all
Reply to author
Forward
0 new messages