Telegram-iOS
Telegram-iOS copied to clipboard
Cannot build Telegram on Xcode 16
Checklist
- [x] I am reporting an issue in existing functionality that does not work as intended
- [x] I've searched for existing GitHub issues
Description
Recently, in Xcode 16, the provisioning profiles folder was moved from its previous location. While the upstream repository includes a fix for this change, it has not yet been applied to https://github.com/ali-fareed/rules_apple.
cc: @ali-fareed
You can find the fix here: https://github.com/bazelbuild/rules_apple/pull/2544
Applying this patch will fix the build:
From aa6aabad86e36cd71f7c452baa4906c9e89254c8 Mon Sep 17 00:00:00 2001
From: Adin Cebic <[email protected]>
Date: Tue, 24 Sep 2024 10:10:21 +0200
Subject: [PATCH 1/2] Support new Xcode 16 mobile provisioning location
Signed-off-by: Adin Cebic <[email protected]>
---
apple/internal/local_provisioning_profiles.bzl | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/apple/internal/local_provisioning_profiles.bzl b/apple/internal/local_provisioning_profiles.bzl
index 50bdbc70a..18e998e0f 100644
--- a/apple/internal/local_provisioning_profiles.bzl
+++ b/apple/internal/local_provisioning_profiles.bzl
@@ -10,10 +10,19 @@ def _provisioning_profile_repository(repository_ctx):
repository_ctx.execute(["mkdir", "-p", system_profiles_path])
repository_ctx.symlink(system_profiles_path, "profiles")
+ # Since Xcode 16 there is a new location for the provisioning profiles.
+ # We need to keep the both old and new path for quite some time.
+ user_profiles_path = "{}/Library/Developer/Xcode/UserData/Provisioning Profiles".format(repository_ctx.os.environ["HOME"])
+ repository_ctx.execute(["mkdir", "-p", user_profiles_path])
+ repository_ctx.symlink(user_profiles_path, "user profiles")
+
repository_ctx.file("BUILD.bazel", """\
filegroup(
name = "profiles",
- srcs = glob(["profiles/*.mobileprovision"], allow_empty = True),
+ srcs = glob([
+ "profiles/*.mobileprovision",
+ "user profiles/*.mobileprovision",
+ ], allow_empty = True),
visibility = ["//visibility:public"],
)
From d2cf011acab719daeee4bbc7d12c980e8ddbaadf Mon Sep 17 00:00:00 2001
From: Adin Cebic <[email protected]>
Date: Tue, 24 Sep 2024 10:11:30 +0200
Subject: [PATCH 2/2] Fix indentation
Signed-off-by: Adin Cebic <[email protected]>
---
apple/internal/local_provisioning_profiles.bzl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/apple/internal/local_provisioning_profiles.bzl b/apple/internal/local_provisioning_profiles.bzl
index 18e998e0f..71d5275ae 100644
--- a/apple/internal/local_provisioning_profiles.bzl
+++ b/apple/internal/local_provisioning_profiles.bzl
@@ -20,8 +20,8 @@ def _provisioning_profile_repository(repository_ctx):
filegroup(
name = "profiles",
srcs = glob([
- "profiles/*.mobileprovision",
- "user profiles/*.mobileprovision",
+ "profiles/*.mobileprovision",
+ "user profiles/*.mobileprovision",
], allow_empty = True),
visibility = ["//visibility:public"],
Expected Behavior
Build should succeed when following the README.
Actual Behavior
App is failing with error:
no provisioning profile was found named ....
Steps to Reproduce
- Update to MacOS sequoia and xcode 16
- Follow README
- Build will fail
Screenshots and Videos
N/A
Environment
Device: Simulator
iOS version: 18.0
App version: ...
The relevant changes have been merged to https://github.com/ali-fareed/rules_apple/tree/reproducible-codesign-no-check
So I guess you need to update the submodule HEAD commit here as well as Telegram iOS does not have those changes. Feel free to close it when it's done.
@matinzd Your patch corrupted
@ali-fareed I checkout to this thread https://github.com/ali-fareed/rules_apple/tree/reproducible-codesign-no-check and try to build project, same issue
@matinzd Your patch corrupted
Apply it manually then. It depends on how you are applying it.
@ali-fareed I checkout to this thread https://github.com/ali-fareed/rules_apple/tree/reproducible-codesign-no-check and try to build project, same issue
Have you followed the README for generating the xcode project?
Use this command instead with --xcodeManagedCodesigning:
python3 build-system/Make/Make.py \
--cacheDir="$HOME/telegram-bazel-cache" \
generateProject \
--configurationPath=build-system/template_minimal_development_configuration.json \
--xcodeManagedCodesigning
@matinzd Thank you for response
Yes, I'm using the command you mentioned (staying here in submodule https://github.com/ali-fareed/rules_apple/tree/reproducible-codesign-no-check), but still have problem with
Maybe another submodule must be updated ? staying on 1d1ea447ad3fdbf9483ce337c532cf0793f3ab3a commit
Xcode 16.0 macOS 15.0.1 Device: Simulator iOS version: 18.0
P.s do I need to choose my profile ?
Look for Telegram target under targets and change the signing to automatic. That should work. Now I see you are on bazel_dependencies target.
@matinzd Sorry for pinging you again.
I am on Telegram target
I have the same problem
I have the same problem
Yeah now this same problem.
Does it anything do with using a free apple developer account ?
@SyysBiir @EshanSingh-ES I don't know why, but I tried to build on real device and its works!
And I tried to build it on simulator and it works .
On Sat, 12 Oct 2024 at 9:20 PM, Pogos @.***> wrote:
I don't know why, but I tried to build on real device and its works!
— Reply to this email directly, view it on GitHub https://github.com/TelegramMessenger/Telegram-iOS/issues/1568#issuecomment-2408607477, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGA7IDSMLUD52JAVPMNR6ODZ3FAMLAVCNFSM6AAAAABPNWAJNKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBYGYYDONBXG4 . You are receiving this because you commented.Message ID: @.***>
And I tried to build it on simulator and it works . … On Sat, 12 Oct 2024 at 9:20 PM, Pogos @.> wrote: I don't know why, but I tried to build on real device and its works! — Reply to this email directly, view it on GitHub <#1568 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGA7IDSMLUD52JAVPMNR6ODZ3FAMLAVCNFSM6AAAAABPNWAJNKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBYGYYDONBXG4 . You are receiving this because you commented.Message ID: @.>
can you help me with this
Look for Telegram target under targets and change the signing to automatic. That should work. Now I see you are on bazel_dependencies target.
Hi @matinzd,
I changed the signing on Telegram target to automatic, but it still gives the following error:
Xcode 15.3 macOS 14.4.1 Device: Simulator
Look for Telegram target under targets and change the signing to automatic. That should work. Now I see you are on bazel_dependencies target.
Hi @matinzd, I changed the signing on Telegram target to automatic, but it still gives the following error:
![]()
Xcode 15.3 macOS 14.4.1 Device: Simulator
You are on Telegram project. Find Telegram under targets and then go to signing and capabilities tab. Then check automatic xcode signing.
Look for Telegram target under targets and change the signing to automatic. That should work. Now I see you are on bazel_dependencies target.
Hi @matinzd, I changed the signing on Telegram target to automatic, but it still gives the following error:
![]()
Xcode 15.3 macOS 14.4.1 Device: Simulator
You are on Telegram project. Find Telegram under targets and then go to signing and capabilities tab. Then check automatic xcode signing.
Thank you so much! I found the Telegram target, but I checked automatically manage signing
then run and still got the same error as above Showing All Messages "no provisioning profile was found named 'iOS Team Provisioning Profile: org.fbe5713796172893.Telegram"
That's the same exact problem I had and I was getting these warnings. As soon as I applied that patch it started working. Try to disable app extensions as it's not needed for this contest and try again.
python3 build-system/Make/Make.py \
--cacheDir="$HOME/telegram-bazel-cache" \
generateProject \
--configurationPath=build-system/template_minimal_development_configuration.json \
--xcodeManagedCodesigning \
--disableExtensions
I guess these are the questions that Telegram team should answer, not me. I hope they clarify these problems in the documentation. Hope that helps.
cp -r ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/* Library/MobileDevice/Provisioning\ Profiles - it helps me
That is a temporary solution but it should work. Because xcode 16 has changed the provisioning profiles folder.
cp -r ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/* Library/MobileDevice/Provisioning\ Profiles- it helps me
Manually copying the provisioning profiles using the command cp -r ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/* ~/Library/MobileDevice/Provisioning\ Profiles/ initially seemed to help. However, the profiles automatically disappear from the directory within a few seconds. I continue to encounter the error shown below when trying to run the app:
Xcode 16.0 Sonoma 14.6.1
I'm using this command:
python3 build-system/Make/Make.py \
--cacheDir="$HOME/telegram-bazel-cache" \
generateProject \
--configurationPath=build-system/template_minimal_development_configuration.json \
--xcodeManagedCodesigning
Could anyone provide the correct steps to successfully set up and run the project? I'm encountering difficulties and would appreciate detailed guidance
@iosdevelopmentzp The proper way would be to use my patch to solve this issue. Copy pasting might not do the work and the files can be removed.
Showing Recent Messages
Build target TelegramCoreFramework of project Btok with configuration Debug
note: Run script build phase 'Copy Bazel Outputs / Generate Bazel Dependencies (Index Build)' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'TelegramCoreFramework' from project 'xxx')
error: Unable to discover swiftc command line tool info: Could not parse Swift versions from: (in target 'TelegramCoreFramework' from project 'xxx')
Run script build phase 'Copy Bazel Outputs / Generate Bazel Dependencies (Index Build)' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked.
Unable to discover swiftc command line tool info: Could not parse Swift versions from: (in target 'TelegramCoreFramework' from project 'xxx')
Xcode: 16.1 iOS: 18
How to fix it?
Maybe it will help someone - instructions on how I was able to run this on Simulator:
-
Clone the project: https://github.com/TelegramMessenger/Telegram-iOS?tab=readme-ov-file#get-the-code
-
In your user's folder on Mac (in the Users folder in the system (aka $HOME)) create a folder
telegram-configuration -
Copy the
build-system/fake-codesigningfolder from the project to thetelegram-configurationfolder from step 2 -
Copy
build-system/appstore-configuration.jsonto thetelegram-configurationfolder from step 2 and rename this file todevelopment-configuration.json -
Generate a simulator-only Xcode project as follows:
python3 build-system/Make/Make.py --overrideXcodeVersion --cacheDir=“$HOME/telegram-bazel-cache” generateProject --configurationPath=“$HOME/telegram-configuration/development-configuration.json” --codesigningInformationPath “$HOME/telegram-configuration/fake-codesigning” --disableExtensions -
Xcode will open with the generated project. Run the project and then start Simulator, where Telegram will appear.
I hope I didn't miss anything, because I was struggling for a long time, but somehow this method helped me to launch it without any problems with provisioning profile.
Important, if you clone a new version later, don't forget to do steps 3 and 4 again
Just in case: MacOS: 14.6.1 Xcode: 16.2 App Version: 11.6
The idea came from this issue: https://github.com/TelegramMessenger/Telegram-iOS/issues/999
Most likely everything is simpler and it's enough just to use this command after step 1:
python3 build-system/Make/Make.py --cacheDir="$HOME/telegram-bazel-cache” generateProject --configurationPath=build-system/appstore-configuration.json --codesigningInformationPath=build-system/fake-codesigning --disableProvisioningProfiles --overrideXcodeVersion
Maybe it will help someone - instructions on how I was able to run this on Simulator:
- Clone the project: https://github.com/TelegramMessenger/Telegram-iOS?tab=readme-ov-file#get-the-code
- In your user's folder on Mac (in the Users folder in the system (aka $HOME)) create a folder
telegram-configuration- Copy the
build-system/fake-codesigningfolder from the project to thetelegram-configurationfolder from step 2- Copy
build-system/appstore-configuration.jsonto thetelegram-configurationfolder from step 2 and rename this file todevelopment-configuration.json- Generate a simulator-only Xcode project as follows:
python3 build-system/Make/Make.py --overrideXcodeVersion --cacheDir=“$HOME/telegram-bazel-cache” generateProject --configurationPath=“$HOME/telegram-configuration/development-configuration.json” --codesigningInformationPath “$HOME/telegram-configuration/fake-codesigning” --disableExtensions- Xcode will open with the generated project. Run the project and then start Simulator, where Telegram will appear.
I hope I didn't miss anything, because I was struggling for a long time, but somehow this method helped me to launch it without any problems with provisioning profile.
Important, if you clone a new version later, don't forget to do steps 3 and 4 again
Just in case: MacOS: 14.6.1 Xcode: 16.2 App Version: 11.6
The idea came from this issue: #999
Most likely everything is simpler and it's enough just to use this command after step 1:
python3 build-system/Make/Make.py --cacheDir="$HOME/telegram-bazel-cache” generateProject --configurationPath=build-system/appstore-configuration.json --codesigningInformationPath=build-system/fake-codesigning --disableProvisioningProfiles --overrideXcodeVersion
Saved me, thank you!
You having just a typo with quotes, it should be not curly quotes
Here is the script with fixed quotes
python3 build-system/Make/Make.py --overrideXcodeVersion \
--cacheDir="$HOME/telegram-bazel-cache" \
generateProject \
--configurationPath="$HOME/telegram-configuration/development-configuration.json" \
--codesigningInformationPath="$HOME/telegram-configuration/fake-codesigning" \
--disableExtensions
hi, maybe someone has encountered this?
/Users/devidkihtenko/Library/Developer/Xcode/DerivedData/Telegram-egivjntzxnlfakfrndoytemupady/Build/Intermediates.noindex/Telegram.build/bazel-out/ios_arm64-dbg-ios-arm64-min13.0-applebin_ios-ST-f0cef7718cc5/bin/submodules/SSignalKit/SwiftSignalKit/SwiftSignalKitFramework/Objects-normal/arm64/SwiftSignalKit.swiftdoc open /Users/devidkihtenko/Library/Developer/Xcode/DerivedData/Telegram-egivjntzxnlfakfrndoytemupady/Build/Products/Debug-iphoneos/bazel-out/ios_arm64-dbg-ios-arm64-min13.0-applebin_ios-ST-f0cef7718cc5/bin/submodules/SSignalKit/SwiftSignalKit/SwiftSignalKitFramework.framework/Modules/SwiftSignalKit.swiftmodule/arm64-apple-ios.swiftdoc: No such file or directory
It's the same mistake for the others. (
@mackFucker check this solution #1785
Xcode 15.3
macOS 14.4.1
Device: Simulator