Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code injection failed due to multiple certificates #41

Open
johnvuko opened this issue Apr 17, 2015 · 18 comments
Open

Code injection failed due to multiple certificates #41

johnvuko opened this issue Apr 17, 2015 · 18 comments

Comments

@johnvuko
Copy link

Hi,
I cannot inject code. I installed the plugin by cloning the git and built it with xcode (6.3 last version).

When I launch my app I see:

+[BundleInjection load] 127.0.0.1
Injection attempting connection to: 127.0.0.1:31442 (see project's main.(m|mm)
Injection attempting connection to: 192.168.1.104:31442 (see project's main.(m|mm)
Connected to "Injection" plugin, ready to load arm64 code.
Param #0 -> 1.000000
Param #1 -> 1.000000
Param #2 -> 1.000000
Param #3 -> 1.000000
Param #4 -> 1.000000
Color #0 -> 0.000000,0.000000,0.000000,1.000000
Color #1 -> 1.000000,0.000000,0.000000,1.000000
Color #2 -> 0.000000,1.000000,0.000000,1.000000
Color #3 -> 0.058130,0.055542,1.000000,1.000000
Color #4 -> 1.000000,1.000000,1.000000,1.000000

So I supposed the project is ready for injection.
But when I want to inject some code, I have got this error:


** RECORDED BUILD SUCCEEDED **


Renaming bundle so it reloads..

rm -rf “/Users/jonathan/Desktop/Codage/EIVO/Moods/iOSInjectionProject/build/Debug-iphoneos/InjectionBundle3.bundle” && cp -r “/Users/jonathan/Desktop/Codage/EIVO/Moods/iOSInjectionProject/build/Debug-iphoneos/InjectionBundle.bundle” “/Users/jonathan/Desktop/Codage/EIVO/Moods/iOSInjectionProject/build/Debug-iphoneos/InjectionBundle3.bundle”

Codesigning with identity ‘iPhone Developer’ for iOS device

iPhone Developer: ambiguous (matches “iPhone Developer: Jonathan Tribouharet (T4N37HB354)” and “iPhone Developer: Jonathan Tribouharet (Q8YU37NSUJ)” in /Users/jonathan/Library/Keychains/login.keychain)

Could not codesign as ‘iPhone Developer’: /Users/jonathan/Desktop/Codage/EIVO/Moods/iOSInjectionProject/build/Debug-iphoneos/InjectionBundle3.bundle at /Users/jonathan/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/common.pm line 51.

main::error(‘Could not codesign as 9hone Developerø/Users/jonathan/D…’) called at /Users/jonathan/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/injectSource.pl line 422

*** Bundle build failed ***

Check Bundle project.


I supposed the bug is because I have multiple certificate (multiple teams on, one personal (developer), one entreprise, and others from my clients) and codesigndon't know which one choose.
I don't know if you indicate to codesign to use the same certificate I use for building my app with xcode.

@johnno1962
Copy link
Owner

HI, you’re nearly there. Use "Product//Open Bundle” to open the bundle project inside which you can select the specific identity. This value is cached in a file <project_root>/isoInjectionProject//identiy.txt. delete it so it gets refreshed. The value in that file is that passed to codesign on the command line.

@johnvuko
Copy link
Author

OK thanks. Maybe you could add this in the documentation.

@troya2
Copy link

troya2 commented Nov 18, 2015

I had to specify the specific signing certificate in the bundle project and put the full name of my signing certificate in identity.txt - i.e. "iPhone Developer: My Name (XX4XXXXX64)" to get it to work.

@johnno1962 johnno1962 reopened this Nov 18, 2015
@oit63
Copy link

oit63 commented Dec 10, 2015

WonderFul Solution, Recommending mention this in README.md, I spent a lot of time to solve this problem.

@johnno1962
Copy link
Owner

I was just about to fix this and it seems this is resolved in Xcode 7.2 GM as the CODE_SIGN_IDENTITY now contains the (XX4XXXXX64) section. Let me know if you still have dificulties after deleteing the iOSInjectionProject/arm64/identity.txt file.

@oit63
Copy link

oit63 commented Dec 13, 2015

Thanks, I would upgrade Xcode to the latest version in two days. And deleting the identity.txt cannot solve it, instead adding signing certificate in identity.txt - i.e. "iPhone Developer: My Name (XX4XXXXX64)" does for me.

@zltunes
Copy link

zltunes commented Dec 20, 2015

thanks for @johnno1962 providing such an genius plugin!!! I run this in simulator, but when it comes to my iPhone device, I received the same problem with @jonathantribouharet ,then as you suggested, I deleted the iOSInjectionProject/arm64/identity.txt file.but it still pops the same problem(ambiguous code identity...).
Finally I have to delete other "iPhone Developer" certificates in login KeyChain to leave only one certificate, as a result it worked for my iPhone device.
But I am confused, since xcode7.2 it allows us to debug with Xcode automatically generating provisioning files for us, why I have to delete other certificates to leave only one?

@zltunes
Copy link

zltunes commented Dec 20, 2015

blew is my problem:

Codesigning with identity 'iPhone Developer' for iOS device
iPhone Developer: ambiguous (matches "iPhone Developer: Name1 (354A2HDVR5)" and "iPhone Developer: Name2 (68X4N6DQ2C)" in /Users/Leon/Library/Keychains/login.keychain)

*** Could not codesign as 'iPhone Developer': /Users/Leon/Documents/iOS_studyDemos/learn_MJExtension/iOSInjectionProject/build/Debug-iphoneos/InjectionBundle2.bundle _

 at /Users/Leon/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/common.pm line 55.
 main::error('Could not codesign as 9hone Developerø/Users/Leon/Docum...') called at /Users/Leon/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/injectSource.pl line 493
_ Bundle build failed ***

@oit63
Copy link

oit63 commented Dec 22, 2015

As we discuss above, This problem can be solved by edit the file iOSInjectionProject/arm64/identity.txt file

@oit63
Copy link

oit63 commented Dec 22, 2015

do not delete it, you should modify the last line As troya2 said that 👍 put the full name of my signing certificate in identity.txt - i.e. "iPhone Developer: My Name (XX4XXXXX64)" to get it to work. iOSInjectionProject/x86_64/identity.txt file

@oit63
Copy link

oit63 commented Dec 22, 2015

unfortunately, I recent change to realm which does not support injection.

@oit63
Copy link

oit63 commented Mar 31, 2016

Realm also Support Injection Now, and I am back for Injection, 👍

@oit63
Copy link

oit63 commented Mar 31, 2016

SomeTimes it need to delete the same name identity in the keychain. Hoping to make a default chose, or a choice options.

@Pr0Ger
Copy link

Pr0Ger commented Jul 8, 2016

Hello, since I have multiple signing identities I manually specified required identity in iOSInjectionProject/arm64/identity.txt

Anyway, I see this error when I try to inject changes:

iPhone Developer: Sergey Petrov (ID): ambiguous (matches "iPhone Developer: Sergey Petrov (ID)" in /Library/Keychains/System.keychain and "iPhone Developer: Sergey Petrov (ID)" in /Users/pr0ger/Library/Keychains/login.keychain)

Of course, I checked system keychain and didn't find any traces of duplicate of my signing identity there. What can I miss?

@johnno1962
Copy link
Owner

I’m afraid I don’t know. Try the sodesigning command from the command line and work from there.

@oit63
Copy link

oit63 commented Aug 3, 2016

thanks, I solve this problem last year.

@jonyMIND
Copy link

Hi I am still facing this problem. but not find out any solution for this. I am using Xcode 9.3. So can anyone please suggest me what should I do.

@johnno1962
Copy link
Owner

Please try the new App store Version of the App https://itunes.apple.com/us/app/injectioniii/id1380446739?ls=1&mt=12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants