iOS Question Local Builder: "codesign wants to access key 'B4i' in your keychain"

Sandman

Expert
Licensed User
My setup:
- A fully updated Mac Mini, running 12.2.1
- Build server 7.5
- Java JDK 8 (because I couldn't understand how to install OpenJDK in the instructions)
- Xcode 13.2.1 (I've run it, and it has installed all it wanted to)
- A project that compiles fine in the hosted builder

When I try to compile a project using this local builder, this pops up in the mac, stopping the compilation:
1646230693354.png


Apparantly I'm not the first one to get that message, and it seems people before me have figured out to solve it. But I have failed to find that solution in the forum. Can somebody please help me and explain what I should do?

(I've tried running the builder with sudo, but that gave a lot of other error messages in B4i.)
 

Sandman

Expert
Licensed User
UPDATE:

I realized I had mistakenly installed the latest version of Xcode. The instructions state I should use Xcode 12. So I find Xcode 12 on Apple's Developer site, and when I try to install that, it informs me that version 12 isn't compatible with Monterey (which is what my mac has, from the factory).

I just wanted to add that I found a mistake I made and tried to fix it, but it wasn't possible to follow the instructions.
 
Upvote 0

Sandman

Expert
Licensed User
What happens after you enter the password?
The dialog just shakes from side to side, to indicate bad password. I've tried the password I use when I log in to the mac, and the password I use for my Apple ID. Neither is accepted. (So it's not a case of multiple password boxes on top of each other, that I've seen other people experiencing.)

Can you post these errors?

Sure:
B4X:
B4i Version: 7.80
Parsing code.    (0.18s)
Building folders structure.    (0.02s)
Running custom action.    (0.20s)
Compiling code.    (0.43s)
Compiling layouts code.    (0.01s)
Compiling debugger engine code.    (2.92s)
Building Xcode project.    (0.12s)
Preparing project for builder.    (0.17s)
    Project size: 0.82 MB
Sending data to remote compiler.    Error
Out: Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -configuration Release "PRODUCT_NAME=MyFineApp 1.5" CONFIGURATION_BUILD_DIR=/Users/sandman/Desktop/B4iBuildServer/UploadedProjects/<user id>/Payload "CODE_SIGN_IDENTITY=iPhone Distribution: MyFineCompanyname (QJV3775KW7)" "OTHER_CODE_SIGN_FLAGS=--keychain <user id>" PROVISIONING_PROFILE=a3fe2068-4471-4ddc-9017-c89224ae2611 -arch arm64

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    ARCHS = arm64
    CODE_SIGN_IDENTITY = iPhone Distribution: MyFineCompanyname (QJV3775KW7)
    CONFIGURATION_BUILD_DIR = /Users/sandman/Desktop/B4iBuildServer/UploadedProjects/<user id>/Payload
    OTHER_CODE_SIGN_FLAGS = --keychain <user id>
    PRODUCT_NAME = MyFineApp 1.5
    PROVISIONING_PROFILE = a3fe2068-4471-4ddc-9017-c89224ae2611

note: Using new build system
note: Using codesigning identity override: iPhone Distribution: MyFineCompanyname (QJV3775KW7)
note: Planning
Analyze workspace

Create build description
Build description signature: d02a169b61db312934e2f10e0aa11117
Build description path: /Users/sandman/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/XCBuildData/d02a169b61db312934e2f10e0aa11117-desc.xcbuild

note: Build preparation complete
warning: Building targets in manual order is deprecated - check "Parallelize build for command-line builds" in the project editor, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current build to suppress this warning
/Users/sandman/Desktop/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 15.2.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 **

Near the end there is this warning:
B4X:
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 15.2.99.
I changed target in the B4i project to 9, but that didn't make a difference. (But I don't have that log on hand, let me know if I should do it again and post an updated log.)

Also near the end there is this error:
B4X:
error: "B4iProject" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'B4iProject' from project 'B4iProject')
As best I could understand, this was something Xcode said. So I launched Xcode and went looking for the Signing & Capabilities editor - and couldn't find it anywhere. (And just to remind: This project compiles fine in the hosted builder, with the provisioning file that I use.)


So in a way I suppose we're getting further when using sudo, but it's such a bad practice that I cringe when I do it. (But I am pragmatic enough to accept it if I have to.)
 
Upvote 0

Sandman

Expert
Licensed User
Does it work with the simulator?
The whole reason for me installing the local builder is that I want to use the Simulator.

You and me had a discussion a couple of days ago regarding Simulator and hosted versus local builder, and you said the Simulator would work fine with the hosted builder. So I started Simulator on the mac and pressed run (like you wrote), and nothing happened.

(I didn't connect B4i with the mac in any way, which feels a bit weird, but considering I don't connect B4A to the emulated Android device either, I thought that it's probably being handled by some invisible network magic.)

Then, in Tools -> Device IP Address I saw an entry for Simulator, so I selected that. When I did that B4i said that Simulator is only supported when using a local builder. At that point I didn't have the energy to start a new thread to once again try to understand under what circumstances Simulator works. So I gave up and decided to just install local builder.

So, to answer your question, as far as I know it doesn't work with the simulator. I haven't tried to download the build from the hosted builder, and doing the whole unzip-thing though. Is that what you want me to try?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is that what you want me to try?
No.

Note that I just tested the builder with sudo and got the same error as the one you got. You should run it without sudo.

Make sure that the hosted builder is unchecked and choose Tools - Device IP Address - Simulator
The simulator should start on the mac if it isn't already running.
Now run the project. What happens?
 
Upvote 0

Sandman

Expert
Licensed User
Note that I just tested the builder with sudo and got the same error as the one you got. You should run it without sudo.
šŸ‘

Make sure that the hosted builder is unchecked and choose Tools - Device IP Address - Simulator
The simulator should start on the mac if it isn't already running.
It does.

Now run the project. What happens?
Well, that worked without issues. Which is great, obviously! Thanks for this! :)


On a sidenote, it's not very easy to find the logic here...
If Simulator connected -> run fine​
If Simulator not connected -> repeatedly ask for a password I don't have​
 
Upvote 0

Sandman

Expert
Licensed User
I just verified this by connecting B4i to my real iPhone, while using the local builder. The same unpassable password box shows up.

Just to check I then switched a handful times between using the Simulator and the real iPhone. Simulator always works fine, and real iPhone gets the password box.

Yes, I'd love to get the modified builder.

By the way, you say that the password is set programmatically. Does that mean it's not even one of mine passwords it asks for? It's something you're using as part of the toolchain somewhere?
 
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
In my case, I was unable to resolve it until I wiped the mac and re-installed the tools.
 
Upvote 0

Sandman

Expert
Licensed User
In my case, I was unable to resolve it until I wiped the mac and re-installed the tools.
It does sound so strange that it would make a difference. Especially since you only use the mac for local builder, so there's not a lot of different installations there...
 
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
It does sound so strange that it would make a difference. Especially since you only use the mac for local builder, so there's not a lot of different installations there...
The interesting part is this:
- I got the mac used, and I wiped it before installation. So it was a fresh install when I faced the problem.
- I re-attempted wiping it multiple times. Not sure if I missed any steps (but unlikely)
- On the last attempt it worked
 
Upvote 0

aminoacid

Active Member
Licensed User
Longtime User
I had this same (or actually - similar) problem. I solved it by creating another user (with Admin privileges) and running the builder from that account.

[And I am running the builder under sudo]
 
Upvote 0

salvadoro

Member
Licensed User
Longtime User
Today I was able to make it work without the need to use sudo but with the modified version of Erel and just putting the password that Erel left predefined. I think the problem may come when the builder is updated.
 
Upvote 0
Top