iOS Question SecKeychainItemImport: Unknown format in import

wl

Well-Known Member
Licensed 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:

wl

Well-Known Member
Licensed User
As I already recreated all keys (now I unchecked the "enable Mac devices" in developer.apple.com) and try to build a B4i-bridge I get the
"code sign wants to access key "B4i" in your keychain (the exact same issue I have when I used my Windows PC to run B4I). To allow this, enter the "b4_default-db" keychain password.

I think my hosted builder account has expired...
 
Upvote 0

Erel

Administrator
Staff member
Licensed User
the exact same issue I have when I used my Windows PC to run B4I
It has nothing to do with this error.

I think my hosted builder account has expired...
My previous suggestion is no longer relevant as the error is different. Your previous keys were of the wrong type.

code sign wants to access key "B4i" in your keychain
Have you started the server with sudo? Also make sure that the current logged in user is an administrator. That's the cause of this issue.
 
Upvote 0

wl

Well-Known Member
Licensed User
Erel,

To be sure I tried running b4i "run as administrator" (didn't make a difference BTW)
On my Mac I'm logged in as my (only) personal user ...

When starting the Builder with sudo, I get the following in b4i when building:

(6T4HF6S2R4)
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
/Users/wim/Documents/B4iBuildServer/UploadedProjects/<user id>/B4iProject.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'B4iProject' from project 'B4iProject')
error: "B4iProject" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'B4iProject' from project 'B4iProject')


Error: ** BUILD FAILED **

I already explictly selected the provisioning profile with #profile file ... to no avail...

thanks

Setting the min-version to 11 in the B4i project gives:

"
(6T4HF6S2R4)
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
error: "B4iProject" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'B4iProject' from project 'B4iProject')
warning: The armv7 architecture is deprecated for your deployment target (iOS 11.0). You should update your ARCHS build setting to remove the armv7 architecture. (in target 'B4iProject' from project 'B4iProject')
"

these are my project attributes:
#ApplicationLabel: B4i Example
#Version: 1.0.0
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#Target: iPhone, iPad
#ATSEnabled: True
#MinVersion: 11
#ProvisionFile: provision.mobileprovision 'without this attributes I got the same error ...

Seems the same problem as in: https://www.b4x.com/android/forum/t...eychain-password-required.132386/#post-836641 (also on an M1) ... The issue is without a solution ? I have the impression b4i with M1 as a local build server just doesn't work ?
 
Last edited:
Upvote 0

mike2ppc

Member
Licensed User
Erel,

To be sure I tried running b4i "run as administrator" (didn't make a difference BTW)
On my Mac I'm logged in as my (only) personal user ...

When starting the Builder with sudo, I get the following in b4i when building:

(6T4HF6S2R4)
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
/Users/wim/Documents/B4iBuildServer/UploadedProjects/<user id>/B4iProject.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'B4iProject' from project 'B4iProject')
error: "B4iProject" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'B4iProject' from project 'B4iProject')


Error: ** BUILD FAILED **

I already explictly selected the provisioning profile with #profile file ... to no avail...

thanks

Setting the min-version to 11 in the B4i project gives:

"
(6T4HF6S2R4)
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
error: "B4iProject" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'B4iProject' from project 'B4iProject')
warning: The armv7 architecture is deprecated for your deployment target (iOS 11.0). You should update your ARCHS build setting to remove the armv7 architecture. (in target 'B4iProject' from project 'B4iProject')
"

these are my project attributes:
#ApplicationLabel: B4i Example
#Version: 1.0.0
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#Target: iPhone, iPad
#ATSEnabled: True
#MinVersion: 11
#ProvisionFile: provision.mobileprovision 'without this attributes I got the same error ...

Seems the same problem as in: https://www.b4x.com/android/forum/t...eychain-password-required.132386/#post-836641 (also on an M1) ... The issue is without a solution ? I have the impression b4i with M1 as a local build server just doesn't work ?
I can only confirm again that M1 processor, Windows 10 ARM in Parallels16 VM work together with local B4iBuildServer and simulator as well as with physically attached devices. Likewise the installation of the B4i-Bridge on a physical device via Apple Configurator 2 work. However, this requires that all components are installed correctly. Finally, it should be said that this is a very complex architecture, and as soon as something does not work, the search can become time-consuming. Giving support remotely via this forum will be very difficult, better would be a Skype or Facetime session to compare the installations. But basically this architecture works, I have it running on 2 devices Mac Mini M1 and MacBook Air M1. Attached 2 videos to give encouragement to stay tuned, the M1 will remain in the next years. And if you only want to develop with one device, then you have to deal with it and get it running.
 

Attachments

  • CompilingInDebugModeOnSimulator.mp4.zip
    301 KB · Views: 15
  • TimeKeepStartDevEnviroment_1_1.mp4 2.zip
    460.6 KB · Views: 15
Upvote 0

wl

Well-Known Member
Licensed User
thanks Mike,
you are right... I am willing to pay for anyone that cab take over my configuration and check what is wrong
 
Upvote 0

mike2ppc

Member
Licensed User
mike,

do you also start the builder with sudo ?
I'm logged in as Admin User and start the b4ibuildserver with this script.

cd Documents
cd Entwicklung
cd sdk
cd b4x
cd B4iBuildServer
java -jar b4ibuildserver.jar

I've attached the script, so you can edit with "TextEdit" in the navigation steps. The script file is placed on my desktop.
 

Attachments

  • StartB4iBuildServer.command.zip
    818 bytes · Views: 18
Upvote 0

mike2ppc

Member
Licensed User
thanks, but what exactly is the admin user in mac ?
I only have my current login...
Systemsettings-> User&Groups
on the left you should see your user by name and under the name the subtitle "admin". And in the right part of the window you should see in the bottom ".... user are allowed to manage the computer ..." or something like that.
 
Upvote 0

wl

Well-Known Member
Licensed User
Only thing I can image is that there is something wrong in the way I generate the provisioning profile ?
Update: now running the builder as non-sudo and receive

/usr/bin/codesign --force --sign 9BA365B9F70EF38FFC1DFCFDC38341D89CEBA67B --keychain <user id> --entitlements /Users/wim/Documents/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i-Bridge.app.xcent --timestamp\=none /Users/wim/Documents/B4iBuildServer/UploadedProjects/<user id>/Payload/B4i-Bridge.app
Warning: unable to build chain to self-signed root for signer "iPhone Distribution: Wim Lambrechts (6T4HF6S2R4)"
/Users/wim/Documents/B4iBuildServer/UploadedProjects/<user id>/Payload/B4i-Bridge.app: errSecInternalComponent
Command CodeSign failed with a nonzero exit code


Error: ** BUILD FAILED **


The following build commands failed:
CodeSign /Users/wim/Documents/B4iBuildServer/UploadedProjects/<user id>/Payload/B4i-Bridge.app
(1 failure)
 
Last edited:
Upvote 0

Erel

Administrator
Staff member
Licensed User
It is impossible to help you if you post a different error each time.

To be sure I tried running b4i "run as administrator" (didn't make a difference BTW)
Not relevant. Don't do it.

Setting the min-version to 11 in the B4i project gives:
Not relevant. Don't do it.

Only thing I can image is that there is something wrong in the way I generate the provisioning profile ?
Update: now running the builder as non-sudo and receive
What has changed?


Warning: unable to build chain to self-signed root for signer "iPhone Distribution: Wim Lambrechts (6T4HF6S2R4)"
This error happens when the builder libraries are outdated. I assume that you are using builder v7.50. Delete its folder including the libs folder and download the builder again.

My guess that the error has nothing to do with the CPU type.
 
Upvote 0

wl

Well-Known Member
Licensed User
I'm logged in as Admin User and start the b4ibuildserver with this script.

cd Documents
cd Entwicklung
cd sdk
cd b4x
cd B4iBuildServer
java -jar b4ibuildserver.jar

I've attached the script, so you can edit with "TextEdit" in the navigation steps. The script file is placed on my desktop.
It is impossible to help you if you post a different error each time.


Not relevant. Don't do it.


Not relevant. Don't do it.


What has changed?



This error happens when the builder libraries are outdated. I assume that you are using builder v7.50. Delete its folder including the libs folder and download the builder again.

My guess that the error has nothing to do with the CPU type.

Wat has changed: I honnestly don't know, but I have the impression this error comes after I click on "Deny" in the window to enter the credentials of the keychain. Probably I clicked 'Deny' once so now it no longer pops up.

I am indeed using builder 7.5 and already cleared the libs, but I'll try again...

The strange thing is that I have set up my old Mac Mini already a few times and never got any issues, and on the M1 I even reinstalled everything to no avail, but as @mike2ppc indicated: it should indeed work (he's so friendly to go through the setup with me in one of the following days !)

One thing I seem to be able to conclude
in the provisioning profile checking the option "Include Mac devices" is no problem on a x86 environment, but seems to cause the "Unknown format in import" when running on M1/Parallels/Windows 10 ARM ?
 
Upvote 0

wl

Well-Known Member
Licensed User
I'm logged in as Admin User and start the b4ibuildserver with this script.

cd Documents
cd Entwicklung
cd sdk
cd b4x
cd B4iBuildServer
java -jar b4ibuildserver.jar

I've attached the script, so you can edit with "TextEdit" in the navigation steps. The script file is placed on my desktop.
 
Upvote 0

wl

Well-Known Member
Licensed User
Reinstalled Xcode, reinstalled B4iBuilder 7.5, reinstalled AC2.
logged in user is administrator

Consistent errors:

* running builder without sudo:
-> "code sign wants to access key "B4i" in your keychain. To allow this, enter the "b4i_default-db" keychain password"

* running builder with sudo:

B4X:
B4i Version: 7.50
Parsing code.    (0.00s)
Building folders structure.    (0.01s)
Compiling code.    (0.01s)
Building designer app.    (0.00s)
Building Xcode project.    (0.12s)
Preparing project for builder.    (0.09s)
    Project size: 0.24 MB
Sending data to remote compiler.    Error
Out: Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -configuration Release PRODUCT_NAME=B4i-Bridge CONFIGURATION_BUILD_DIR=/Users/wim/Documents/B4iBuildServer/UploadedProjects/<user id>/Payload "CODE_SIGN_IDENTITY=iPhone Distribution: Wim Lambrechts (6T4HF6S2R4)" "OTHER_CODE_SIGN_FLAGS=--keychain <user id>" PROVISIONING_PROFILE=9468f969-9919-4aa0-8fa8-01c114503122 -arch armv7 -arch arm64

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    ARCHS = armv7 arm64
    CODE_SIGN_IDENTITY = iPhone Distribution: Wim Lambrechts (6T4HF6S2R4)
    CONFIGURATION_BUILD_DIR = /Users/wim/Documents/B4iBuildServer/UploadedProjects/<user id>/Payload
    OTHER_CODE_SIGN_FLAGS = --keychain <user id>
    PRODUCT_NAME = B4i-Bridge
    PROVISIONING_PROFILE = 9468f969-9919-4aa0-8fa8-01c114503122

note: Using new build system
note: Using codesigning identity override: iPhone Distribution: Wim Lambrechts (6T4HF6S2R4)
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
/Users/wim/Documents/B4iBuildServer/UploadedProjects/<user id>/B4iProject.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'B4iProject' from project 'B4iProject')
error: "B4iProject" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'B4iProject' from project 'B4iProject')


Error: ** BUILD FAILED **

PS: when installing, removing applications my Mac very often ask for my password. Not sure this might be a related security issue ?

So: It seems I'm in the exact same situation as in: https://www.b4x.com/android/forum/t...eychain-password-required.132386/#post-836641
 
Last edited:
Upvote 0
Top