iOS Question SecKeychainItemImport: Unknown format in import

wl

Well-Known Member
Licensed User
Longtime User
Hi,

I recently set up a local environment (x86 on a Mac Mini) without issues.

Now I'm setting up an M1 (apple Silicone) environment to build my B4i apps, and when building a B4i-bridge app I get:


B4i Version: 7.50
Parsing code. (0.02s)
Building folders structure. (0.01s)
Running custom action. (0.04s)
Compiling code. (0.03s)
Building designer app. (0.01s)
Building Xcode project. (0.11s)
Preparing project for builder. (0.07s)
Project size: 0.24 MB
Sending data to remote compiler. Error
Error: security: SecKeychainItemImport: Unknown format in import.


No errors in the B4iBuilder log files.
I already tried to recreate all keys twice.

Anyone an idea ?
Thanks

PS: I *can* build a simulator release app, but just not the B4i-bridge app
 
Last edited:

mike2ppc

Member
Licensed User
Longtime User
Hi,

I recently set up a local environment (x86 on a Mac Mini) without issues.

Now I'm setting up an M1 (apple Silicone) environment to build my B4i apps, and when building a B4i-bridge app I get:


B4i Version: 7.50
Parsing code. (0.02s)
Building folders structure. (0.01s)
Running custom action. (0.04s)
Compiling code. (0.03s)
Building designer app. (0.01s)
Building Xcode project. (0.11s)
Preparing project for builder. (0.07s)
Project size: 0.24 MB
Sending data to remote compiler. Error
Error: security: SecKeychainItemImport: Unknown format in import.


No errors in the B4iBuilder log files.
I already tried to recreate all keys twice.

Anyone an idea ?
Thanks

PS: I *can* build a simulator release app, but just not the B4i-bridge app
Did you've tried to use Apple Configurator 2 instead of B4i-Bridge ?

Installing apps with Apple Configurator 2
 
Last edited:
  • Like
Reactions: wl
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Hi Mike,

On my x86 iMac I indeed also needed to install Apple Configurator 2, but then I still (also) used the B4i-Bridge?

Are you saying that B4i-Bridge is no longer needed when using Apple Configurator: also for designing of the screen and debugging ?

If I just "run" the application in B4i, I get:

"
B4i Version: 7.50
Parsing code. (0.02s)
Building folders structure. (0.01s)
Running custom action. (0.03s)
Compiling code. (0.07s)
Compiling layouts code. (0.00s)
Compiling debugger engine code. Error

Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
"

It's running on a 16GB Mac Mini with 6 GB assigned to Windows 10 ARM, and I also restarted the VM.

Thanks !
 
Upvote 0

mike2ppc

Member
Licensed User
Longtime User
Hi Mike,

On my x86 iMac I indeed also needed to install Apple Configurator 2, but then I still (also) used the B4i-Bridge?

Are you saying that B4i-Bridge is no longer needed when using Apple Configurator: also for designing of the screen and debugging ?

If I just "run" the application in B4i, I get:

"
B4i Version: 7.50
Parsing code. (0.02s)
Building folders structure. (0.01s)
Running custom action. (0.03s)
Compiling code. (0.07s)
Compiling layouts code. (0.00s)
Compiling debugger engine code. Error

Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
"

It's running on a 16GB Mac Mini with 6 GB assigned to Windows 10 ARM, and I also restarted the VM.

Thanks !
You are able to run a new small project with only one page and one control on it ? To be sure that it is not a general problem.
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
yes indeed: I get this error with a test app with just one page and a button.

currently fully reinstalling the M1 and see what happens ...
 
Upvote 0

mike2ppc

Member
Licensed User
Longtime User
yes indeed: I get this error with a test app with just one page and a button.

currently fully reinstalling the M1 and see what happens ...
I've setup win10 in Parallels only with 3GB Ram and 30GB HDD, so that can't be the reason in your case.
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Reinstalled EVERYTHING: still the same issue.

Trying the Apple Configurator 2:
- started the application: it shows the desktop of my connected iPhone
- when I just RUN the application, b4i indicates: "no devices are booted"
(this does work on my x86 Mac mini without any issues ...)

When I first start a simulator everything is working fine... But just how can I debug on my device (need push notifications ...)
How exactly should I run an application in debug mode on my connected iPhone, and how exactly should I be able to layout the pages on my iPhone ?

Thanks !
 
Last edited:
Upvote 0

mike2ppc

Member
Licensed User
Longtime User
Reinstalled EVERYTHING: still the same issue.

Trying the Apple Configurator 2:
- started the application: it shows the desktop of my connected iPhone
- when I just RUN the application, b4i indicates: "no devices are booted"
(this does work on my x86 Mac mini without any issues ...)

When I first start a simulator everything is working fine... But just how can I debug on my device (need push notifications ...)
How exactly should I run an application in debug mode on my connected iPhone, and how exactly should I be able to layout the pages on my iPhone ?

Thanks !
Installing apps with Apple Configurator 2
Importend to work with Apple Configurator 2 together in compiling process is this flag
Bildschirmfoto 2021-08-29 um 00.13.45.png
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
yes, exactly what I did :-(
on x86 working great, on M1 no way that I get it working :-(
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Hi @Erel, after reinstalling everything I no longer have the error in #3

I *am* using AC2, installed automation tools and checked it in B4i.

Situation (when running B4i in parallels in Windows 10 ARM)
- I start AC2 and I can see my connected device
- when I run the application I get: "no device was booted" as if it was searching for a simulator (which I did not start)
- when I try to build a B4i-bridge app I get the "Unknown format in import" error

Other situation (when running on M1 but B4i on Windows PC)
- running without simulator -> no device booted
- when trying to build a B4iBridge app -> password issue (asking for keychain password for default-db)
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I start AC2 and I can see my connected device
Not sure what you mean. You don't need to start AC2.

when I run the application I get: "no device was booted" as if it was searching for a simulator (which I did not start)
The only way that such message can appear is if you are building for the simulator.
All other information is irrelevant. Please only answer my questions.

Choose Tools - Build Server - Build B4i-Bridge. Post the compilation window text and if possible the server logs.
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
B4i output:

"
B4i Version: 7.50
Parsing code. (0.02s)
Building folders structure. (0.01s)
Running custom action. (0.03s)
Compiling code. (0.03s)
Building designer app. (0.01s)
Building Xcode project. (0.11s)
Preparing project for builder. (0.07s)
Project size: 0.24 MB
Sending data to remote compiler. Error
Error: security: SecKeychainItemImport: Unknown format in import."

Serverlogs:

"
10.37.129.2 - - [29/Aug/2021:08:39:12 +0000] "POST /pushkey?csr=true HTTP/1.1" 200 904 "-" "-"
10.37.129.2 - - [29/Aug/2021:08:40:27 +0000] "POST /simulator HTTP/1.1" 200 0 "-" "-"
10.37.129.2 - - [29/Aug/2021:08:40:27 +0000] "POST /build HTTP/1.1" 200 68 "-" "-"
10.37.129.2 - - [29/Aug/2021:08:40:38 +0000] "POST /build HTTP/1.1" 200 63 "-" "-"
10.37.129.2 - - [29/Aug/2021:08:42:30 +0000] "POST /build HTTP/1.1" 200 63 "-" "-"
10.37.129.2 - - [29/Aug/2021:08:42:44 +0000] "POST /build HTTP/1.1" 200 63 "-" "-"
10.37.129.2 - - [29/Aug/2021:08:46:22 +0000] "POST /simulator HTTP/1.1" 200 0 "-" "-"
10.37.129.2 - - [29/Aug/2021:08:46:25 +0000] "POST /build HTTP/1.1" 200 63 "-" "-"
10.37.129.2 - - [29/Aug/2021:09:07:29 +0000] "POST /build HTTP/1.1" 200 63 "-" "-"
10.37.129.2 - - [29/Aug/2021:09:09:12 +0000] "POST /build HTTP/1.1" 200 1 "-" "-"
10.37.129.2 - - [29/Aug/2021:09:10:43 +0000] "POST /build HTTP/1.1" 200 1 "-" "-"
10.37.129.2 - - [29/Aug/2021:09:11:25 +0000] "POST /build HTTP/1.1" 200 1 "-" "-"
10.37.129.2 - - [29/Aug/2021:09:12:39 +0000] "POST /build HTTP/1.1" 200 68 "-" "-"
10.37.129.2 - - [29/Aug/2021:09:13:44 +0000] "POST /build HTTP/1.1" 200 68 "-" "-"
"
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
"
11:09:17| Compilation time: 5264, b4i_default, queue: 0, success: true
11:10:49| Compilation time: 5833, b4i_default, queue: 0, success: true
11:11:30| Compilation time: 4883, b4i_default, queue: 0, success: true
Adding user to keychain: b4i_default
success: true, 1
11:12:39| Compilation time: 261, b4i_default, queue: 0, success: false
Adding user to keychain: b4i_default
success: true, 1
11:13:44| Compilation time: 249, b4i_default, queue: 0, success: false
Adding user to keychain: b4i_default
success: true, 1
11:16:46| Compilation time: 247, b4i_default, queue: 0, success: false"


Restarted the server for full output:
"
wim@Wims-Mac-mini Documents % java -jar B4iBuildServer.jar
Build server version: 7.5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-08-29 11:34:06.320:INFO::main: Logging initialized @290ms to org.eclipse.jetty.util.log.StdErrLog
Loading default configuration file.
AppPath=/Users/wim/Documents
Mac version: 11.5
Xcode path: /Applications/Xcode.app/Contents/Developer
Xcode version: 12.5
2021-08-29 11:34:07.316:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 16.0.2+7-67
2021-08-29 11:34:07.365:INFO:eek:ejs.session:main: DefaultSessionIdManager workerName=node0
2021-08-29 11:34:07.365:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2021-08-29 11:34:07.369:INFO:eek:ejs.session:main: node0 Scavenging every 600000ms
2021-08-29 11:34:07.376:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@22eeefeb{/,file:///Users/wim/Documents/www,AVAILABLE}
2021-08-29 11:34:07.380:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened /Users/wim/Documents/logs/b4j-2021_08_29.request.log
2021-08-29 11:34:07.406:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@7dd89d26{HTTP/1.1,[http/1.1]}{0.0.0.0:51041}
2021-08-29 11:34:07.633:INFO:eek:ejus.SslContextFactory:main: x509=X509@8909f18(jetty,h=[10.37.129.2],w=[]) for SslContextFactory@79ca92b9[provider=null,keyStore=file:///Users/wim/Documents/key/key.jks,trustStore=null]
2021-08-29 11:34:07.636:INFO:eek:ejus.SslContextFactory:main: x509=X509@1460a8c0(rootca,h=[],w=[]) for SslContextFactory@79ca92b9[provider=null,keyStore=file:///Users/wim/Documents/key/key.jks,trustStore=null]
2021-08-29 11:34:07.773:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@5158b42f{SSL,[ssl, http/1.1]}{0.0.0.0:51042}
2021-08-29 11:34:07.779:INFO:eek:ejs.Server:main: Started @1754ms
Build server is ready
Build server version: 7.50
Adding user to keychain: b4i_default
success: true, 1
11:34:20| Compilation time: 244, b4i_default, queue: 0, success: false"
 
Last edited:
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Tried it: same result:

"
wim@Wims-Mac-mini Documents % sudo java -jar B4iBuildServer.jar
Build server version: 7.5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-08-29 12:41:44.489:INFO::main: Logging initialized @255ms to org.eclipse.jetty.util.log.StdErrLog
Loading default configuration file.
AppPath=/Users/wim/Documents
Mac version: 11.5
Xcode path: /Applications/Xcode.app/Contents/Developer
Xcode version: 12.5
2021-08-29 12:41:44.887:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 16.0.2+7-67
2021-08-29 12:41:44.930:INFO:eek:ejs.session:main: DefaultSessionIdManager workerName=node0
2021-08-29 12:41:44.930:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2021-08-29 12:41:44.933:INFO:eek:ejs.session:main: node0 Scavenging every 660000ms
2021-08-29 12:41:44.940:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@22eeefeb{/,file:///Users/wim/Documents/www,AVAILABLE}
2021-08-29 12:41:44.943:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened /Users/wim/Documents/logs/b4j-2021_08_29.request.log
2021-08-29 12:41:44.965:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@69379752{HTTP/1.1,[http/1.1]}{0.0.0.0:51041}
2021-08-29 12:41:45.210:INFO:eek:ejus.SslContextFactory:main: x509=X509@79ca92b9(jetty,h=[10.37.129.2],w=[]) for SslContextFactory@1460a8c0[provider=null,keyStore=file:///Users/wim/Documents/key/key.jks,trustStore=null]
2021-08-29 12:41:45.212:INFO:eek:ejus.SslContextFactory:main: x509=X509@4f638935(rootca,h=[],w=[]) for SslContextFactory@1460a8c0[provider=null,keyStore=file:///Users/wim/Documents/key/key.jks,trustStore=null]
2021-08-29 12:41:45.352:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@595b007d{SSL,[ssl, http/1.1]}{0.0.0.0:51042}
2021-08-29 12:41:45.357:INFO:eek:ejs.Server:main: Started @1126ms
Build server is ready
Build server version: 7.50
Adding user to keychain: b4i_default
success: true, 1
12:41:53| Compilation time: 226, b4i_default, queue: 0, success: false
"

And the same "Error: security: SecKeychainItemImport: Unknown format in import." in b4i...

Does it make sense to try another JDK on the Windows (ARM VM) machine ?
Currently running:
java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)

--> to answer my own question: NO: tried with openjdk 11: same error ...

I found this page: https://forum.ionicframework.com/t/ionic-package/34654/4
But I'm not sure how/if it is related as I did all steps as required for the keys...

These are my keys:
"
Directory of C:\b4x\keys

08/29/2021 10:40 AM <DIR> .
08/28/2021 07:14 PM <DIR> ..
08/29/2021 10:39 AM 2,133 B4i.keystore
08/29/2021 10:39 AM 2,595 B4i.p12
08/29/2021 10:39 AM 903 certSigningRequest.csr
08/29/2021 10:39 AM 1,467 ios_distribution.cer
08/29/2021 10:40 AM 12,400 provision.mobileprovision"
 
Last edited:
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Hi Erel,

I do have a hosted builder account. Fact is that if I do exactly the same on my old mac mini (x86) (I always recreate all keys from scratch) it works flawlessly ...
And I really would like to use the M1 building speed ...
 
Upvote 0
Top