Telegram-iOS icon indicating copy to clipboard operation
Telegram-iOS copied to clipboard

A valid provisioning profile for this executable was not found (xcode)

Open jalalimehdi opened this issue 4 years ago • 10 comments

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

A valid provisioning profile for this executable was not found. I receive the above error, despite having a valid provisioning profile which, as far as I can tell matches the bundle identifier. I encountered this problem when I was trying to test on my iPhone. I of course updated the app's development and distribution profiles to use these new certificates and made sure to re-download them to my workstation. I simply had to use a Distribution Profile of type Ad Hoc. I know this has been asked and answered multiple times but I'm tearing my hair out as none of the proposed solutions appears to work. refer to this post: stackoverflow.com/questions/52424462/

Expected Behavior

App launches in actual device

Actual Behavior

A valid provisioning profile for this executable was not found. Screen Shot 2022-04-12 at 2 42 57 AM

Steps to Reproduce

  1. Build the app (I succeeded to build the app)
python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    build \
    --configurationPath="$HOME/telegram-configuration" \
    --buildNumber=100001 \
    --configuration=release_universal

2.I generated the project with this command

python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    generateProject \
    --configurationPath="$HOME/telegram-configuration" \
    --disableExtensions
  1. App launches in simulator
  2. App isn't launches in actual device

Screenshots and Videos

Screen Shot 2022-04-12 at 3 06 07 AM Screen Shot 2022-04-12 at 2 58 58 AM

Environment

**App version: ** 8.6.1

**Bazel version: ** 5.1.0

**xCode version: ** 13.2.1

**MacOS version: ** 12.3.1

jalalimehdi avatar Apr 11 '22 22:04 jalalimehdi

If you try to debug the app via Xcode, you should let Xcode manage the signing identity automatically.

shivanraptor avatar Apr 13 '22 02:04 shivanraptor

Hi @shivanraptor when I try to debug the app via Xcode and Xcode manage the signing identity automatically

My Debug Area logs

2022-04-13 11:30:04.554526+0430 Telegram[14071:5511012] [Warning] Trying to set delaysTouchesBegan to NO on a system gate gesture recognizer - this is unsupported and will have undesired side effects
2022-04-13 11:30:04.578307+0430 Telegram[14071:5511012] [unspecified] container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
Architecture: arm64
Embedded signature, length: 4876
2022-04-13 11:30:04.591616+0430 Telegram[14071:5511012] [Presentation] Attempt to present <UIAlertController: 0x10602ae00> on <_TtC7DisplayP33_83BFFE1175986BF91B85BE8424379B0424WindowRootViewController: 0x10360f0d0> (from <_TtC7DisplayP33_83BFFE1175986BF91B85BE8424379B0424WindowRootViewController: 0x10360f0d0>) whose view is not in the window hierarchy.

app has black screen on device. works fine on simulator. Launch my device from Xcode and getting a black screen I taked a screenshot IMG_5297 Screen Shot 2022-04-13 at 12 12 54 PM

jalalimehdi avatar Apr 13 '22 07:04 jalalimehdi

Hi @shivanraptor when I try to debug the app via Xcode and Xcode manage the signing identity automatically

My Debug Area logs

2022-04-13 11:30:04.554526+0430 Telegram[14071:5511012] [Warning] Trying to set delaysTouchesBegan to NO on a system gate gesture recognizer - this is unsupported and will have undesired side effects
2022-04-13 11:30:04.578307+0430 Telegram[14071:5511012] [unspecified] container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
Architecture: arm64
Embedded signature, length: 4876
2022-04-13 11:30:04.591616+0430 Telegram[14071:5511012] [Presentation] Attempt to present <UIAlertController: 0x10602ae00> on <_TtC7DisplayP33_83BFFE1175986BF91B85BE8424379B0424WindowRootViewController: 0x10360f0d0> (from <_TtC7DisplayP33_83BFFE1175986BF91B85BE8424379B0424WindowRootViewController: 0x10360f0d0>) whose view is not in the window hierarchy.

app has black screen on device. works fine on simulator. Launch my device from Xcode and getting a black screen I taked a screenshot IMG_5297 Screen Shot 2022-04-13 at 12 12 54 PM

Hi, how did you manage to run it on device? I tried ticking the signing identity automatically and added required capabilities but still got same error. Thank you in advance

kebbbnnn avatar May 08 '22 14:05 kebbbnnn

Never mind, I've fixed it. For those who encountered this issue this is what I did.

Step 1: Go to apple dev portal and generate new certificate for development then download and add it to your keychain. Generate new provisioning profiles for the app targeting that new cert for development.

Step 2: Duplicate telegram-configuration folder and rename it telegram-configuration-development replace all provisioning profiles with the ones that targets development. In the variables.bzl file change the value of telegram_aps_environment from production to development

Step 3: clean the project with command:

python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    clean

then generate the xcode project:

python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    generateProject \
    --configurationPath="$HOME/telegram-configuration-development"

And that's it. You can now select your iOS device in your target and run the app on your device

kebbbnnn avatar May 09 '22 02:05 kebbbnnn

Hi @kebbbnnn I did all three steps, unfortunately the problem was not solved. My Debug Area logs

2022-05-09 20:22:56.716773+0430 Telegram[2348:970021] [Warning] Trying to set delaysTouchesBegan to NO on a system gate gesture recognizer - this is unsupported and will have undesired side effects 2022-05-09 20:22:56.740646+0430 Telegram[2348:970021] [unspecified] container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled Architecture: arm64 Embedded signature, length: 4876 2022-05-09 20:22:56.760241+0430 Telegram[2348:970021] [Presentation] Attempt to present <UIAlertController: 0x10882da00> on <_TtC7DisplayP33_83BFFE1175986BF91B85BE8424379B0424WindowRootViewController: 0x105a0f830> (from <_TtC7DisplayP33_83BFFE1175986BF91B85BE8424379B0424WindowRootViewController: 0x105a0f830>) whose view is not in the window hierarchy.

Screen Shot 2022-05-09 at 8 37 36 PM Screen Shot 2022-05-09 at 8 09 30 PM Screen Shot 2022-05-09 at 8 09 49 PM

jalalimehdi avatar May 09 '22 15:05 jalalimehdi

Hi @jalalimehdi I am stuck in that black screen too, did you manage to solve it? <-- Solved

The black screen was caused for an alert that is called when, in AppDelegate, FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroupName) is not able to return a group name, I don't know why can obtain it in simulator, but no in device. To fix this I went to App Capabilities and added Group capabilities with the group declared in the provisioning profile. With this the app executes in device, now my problem is that, keeping signing automatically, if I try to run the app again, the problem of the Unable to install "telegram" reappears and I have to recreate the project again.

eduhcano avatar Jun 15 '22 15:06 eduhcano

@kebbbnnn Can you help me out~ da@DadeMacBook-Pro Telegram-iOS % python3 build-system/Make/Make.py
--cacheDir="$HOME/telegram-bazel-cache"
generateProject
--configurationPath="$HOME/telegram-configuration-development" Traceback (most recent call last): File "/Users/da/Telegram-iOS/build-system/Make/Make.py", line 726, in generate_project(bazel=bazel_path, arguments=args) File "/Users/da/Telegram-iOS/build-system/Make/Make.py", line 414, in generate_project bazel_command_line = BazelCommandLine( File "/Users/da/Telegram-iOS/build-system/Make/Make.py", line 16, in init self.build_environment = BuildEnvironment( File "/Users/da/Telegram-iOS/build-system/Make/BuildEnvironment.py", line 130, in init actual_bazel_version = get_bazel_version(self.bazel_path) File "/Users/da/Telegram-iOS/build-system/Make/BuildEnvironment.py", line 66, in get_bazel_version command_result = run_executable_with_output(bazel_path, ['--version']).strip('\n') File "/Users/da/Telegram-iOS/build-system/Make/BuildEnvironment.py", line 36, in run_executable_with_output process = subprocess.Popen( File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) OSError: [Errno 8] Exec format error: '/Users/da/Telegram-iOS/build-input/bazel-5.1.0-x86_64'

liujia1993 avatar Jun 16 '22 09:06 liujia1993

Never mind, I've fixed it. For those who encountered this issue this is what I did.

Step 1: Go to apple dev portal and generate new certificate for development then download and add it to your keychain. Generate new provisioning profiles for the app targeting that new cert for development.

Step 2: Duplicate telegram-configuration folder and rename it telegram-configuration-development replace all provisioning profiles with the ones that targets development. In the variables.bzl file change the value of telegram_aps_environment from production to development

Step 3: clean the project with command:

python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    clean

then generate the xcode project:

python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    generateProject \
    --configurationPath="$HOME/telegram-configuration-development"

And that's it. You can now select your iOS device in your target and run the app on your device

Hello, do you still need to check Automatic management signing after following these three steps。 Now, no matter whether automatic certificate configuration is checked or not, I will report an error when running on the real machine.

mailes avatar Oct 27 '22 14:10 mailes

111

caicaibuchicai avatar Feb 14 '23 09:02 caicaibuchicai

Can you explain more? in https://developer.apple.com/account/resources/identifiers/list i create Identifiers and Profiles 1 02 and i change variables.bzl but after run show this error could not find a valid aps-environment entitlement in the provided provisiong profiles i think my profile and Identifiers create wrong

saeedcfc avatar Mar 07 '23 10:03 saeedcfc