I'm filling in the Codemagic yaml file to perform an iOS deploy for React Native. However, an error occurs while the builder is fetching the signing files:
Executing AppStoreConnect action fetch-signing-files failed unexpectedly.
Detailed logs are available at
"/var/folders/m7/aegaegawegaw323523t232/T/codemagic-09-01-22.log".
To see more details about the error, add `--verbose` command line option.
The error message is too vague. It simply tells me to use --verbose, which returns
[12:28:30] DEBUG > Load JWT for App Store Connect key 'NAME_OF_KEY' from disk cache
[12:28:30] DEBUG > Failed to load App Store Connect JWT from disk cache:
Token is not cached
[12:28:30] DEBUG > Generate new App Store Connect JWT for key 'NAME_OF_KEY'
[12:28:30] WARNING > Executing AppStoreConnect action fetch-signing-files failed unexpectedly.
Detailed logs are available at "/var/folders/m7/aegaegawegaw323523t232/T/codemagic-09-01-22.log".
To see more details about the error, add `--verbose` command line option.
Which still is not enough for me to understand what's going on. My question is how do I access the Codemagic log at the mentioned codemagic-09-01-22.log file?
with Codemagic you can access builder machine via SSH or VNC (https://docs.codemagic.io/troubleshooting/accessing-builder-machine-via-ssh/) to check all logs.
However from the log you provided are you sure you configured correct key name?
I am trying to import an RSA Key.
I open cmd prompt in Admin mode, go to C:\Windows\Microsoft.NET\Framework64\v4.0.30319 and my command is as follows: aspnet_regiis - pi "Key" "S:\RSAKeys\Key.xml" -pku
This is the exact same command that my coworker used and it worked perfectly for him. When I try it though, I get "Importing RSA Keys from file..Unable to find the specified file. Failed!"
What could be different between our machines?
I have also tried different things (removing the -pku, trying it not as admin, etc.) but in the end it doesn't fully work.
Trying it not as admin with -pku will say succeeded (but then when I try to use the service, it errors with "The RSA key container could not be opened"). Trying it not as admin without -pku will error with "Access is denied."
Edit 1: Looks like a read perms issue between S drive and C drive maybe. Putting the file on the C drive was able to succeed the import but still receiving an error from the service that uses the import saying the rsa key container could not be opened.
Final Edit: After some research, I discovered that I needed to change permissions. I used these documents to help: https://serverfault.com/questions/293416/the-rsa-key-container-could-not-be-opened-windows-server-2008-r2 http://austrianalex.com/rsaprotectedconfigurationprovider-not-recommended-for-children-under-5.html The RSA key container could not be opened
Unfortunately, none of them fixed the problem. Somehow, the RSA key was imported where even the Admin group didn't have the permissions it needed to change permissions. So I went and found the RSA key under the C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys folder. I had originally tried giving the Administrator group (which was only me anyways) full permissions but received a Safe Handle Error and had to remove that.
Finally, I added myself (not the administrator group) with full permissions and it worked. Thanks #Thymine for pointing me in the right direction!
I feel I have properly signed a Tizen for wearable .wgt file.
Is there a way to 'dump' the info for a .wgt to have it display security credentials (cert info), etc, to verify the .wgt has been signed correctly?
If you're using the command line interface, you can pass in the argument to log the signing process as the following.
cd .buildResult/ // you need to be where you have your build
web-signing -l info -p your_profile_name:path_to_your_profile
(you can replace "info" with the following: error, warning, info, debug, or trace)
for more details, search for command line interface in the IDE help content.
I have integrated my application with Facebook, and for this I am using Facebook's Graph API. I am retrieving profile and friends information. It is working fine on my device which has Android 2.3 (Gingerbread), but recently my client has faced an issue while he is trying to connect to Facebook through my app. He has Android 4.0 (Ice Cream Sandwich) on his device. When he clicks a button on the app that takes him to the Facebook login screen, after login he gets a message:
My app is misconfigured for Facebook login. Press Okay to go back to the application without connecting to Facebook.
I am not getting what is the problem whether it is related to Android version or what.
How can I fix this problem?
I work at Facebook, and this is an important issue that needs to be addressed. The other answer for this question suggests that disabling SSO is very bad and will open up your app to malicious apps that can steal your user's Facebook credentials.
The hack launches a WebView dialog to Facebook without SSO, and the user must type their login credentials into that dialog. Malicious apps can then steal this information easily. It is always advised to implement Facebook SSO correctly to ensure that your app is secure and protect your user's sensitive data.
Prior to adding this error message, the dialog would automatically close without warning and fail silently. We added this error message to visually display that there is an issue with your app configuration in your Facebook app dashboard. For Android, if you check your LogCat, you'll see that after pressing "Okay", there should be an error message that will display a more technical description of what is causing the authentication to fail.
For example, if you use our Hackbook example and did not supply your own APP_ID in the source and did not add your hash key to the dashboard, you'll see this error in LogCat after pressing "Okay" in the native SSO dialog (if Util.ENABLE_LOG is set to true):
D/Facebook-authorize(24739): Login failed: invalid_key:Android key mismatch. Your key "uk3udeH7vrOGNFH2FJjdJbdWJWI" does not match the allowed keys specified in your application settings. Check your application settings at http://www.facebook.com/developers
We added the visual error message to help you. This, in theory, does not break previous implementations if it was implemented correctly to begin with. If you see this error message, that means you did not configure your app settings correctly on your dashboard.
Double check your Android Class/Package name, Android hash keys, etc. You will not see this message if you did everything correctly.
In summary, you are getting that error message because there is an issue with your app configuration, for example, a mismatch between the Android hash keys in your dashboard. Before Facebook added this error message, the dialog would launch, then automatically close and fail. To fix this, check your LogCat for any error messages and make sure that you have everything implemented correctly. You can read up on our documentation to make sure you have everything correct. Do not use the accepted answer for this question.
You can also follow the external bug report that a Facebook developer has reported for more updates.
Try to set it like this:
First download OpenSSL (if you have a 64-bit machine you must download openssl-0.9.8e X64, not the latest version, openssl-0.9.8k X64, because the output will not be valid). Extract your files, create the folder openssl, for example in C:/ and copy files there.
Find your path to keytoo. Mine is C:\Program Files\Java\jdk1.7.0_05\bin.
Find your path to debug.keystore. YHou can see what is path if you open in Eclipse, menu Window -> Preferences -> Android -> Build, and you will see Default Debug keystore:-and the path.
Find your path to openssl. Mine is C:\openssl8e\bin/.
Open cmd and type:
"C:\Program Files\Java\jdk1.7.0_05\bin\keytool" -exportcert -alias androiddebugkey -keystore "C:\Users\User.android\debug.keystore" | "C:\openssl8e\bin\openssl" sha1 -binary | "C:\openssl8e\bin\openssl" base64
Aand then press Enter.
Insert password: android
You will get your hash key for debug.keystore.
When you export a signed APK, and you create a keystore for the application, just replace in cmd debugkeystore alias with your alias for the app, the keystore path with the path to your newly created keystore for the app and insert the password for your app.keystore, and you will get a new hash key for your signed app.
The answer from Jesse Chen is fine. Facebooks SDK works fine, don't break it.
I again ran into this problem and found out that the Facebook SDK documentation is corrected and is very fine now. Now it is guiding how to debug and release hash keys can be set; just do as it says.
Below is my old story. There is missing that you can set two hash keys, one for debugging and one for signed, released application for the old Play Store.
I found out that problem was in my case in the Facebook SDK's documentation. It guided us to use the debug key hash and put it in Facebook's app configuration. Hash is guided to get this way:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
This works fine, when you are dubugging or running application from Eclipse.
But, if you publish your application to Andoid Play, you must use your own publisher key to export the signed .apk file. With that .apk, the hash in the Facebook app console is not valid any more! You must get a hash for the developer key like this:
keytool -exportcert -alias <developer alias> -keystore ~/.android/<developer keystore> | openssl sha1 -binary | openssl base64
And put it in the Android Key Hash in the Facebook app console for your published application. After that, SSO works fine again for your signed .apk file.
From what I could gather, it's a Facebook problem and has been reported. But, the problem persists.
A way around this (tested on 2.3.3) is to hack on the Facebook SDK, seach for the 2 authorize methods and change the DEFAULT_AUTH_ACTIVITY_CODE to FORCE_DIALOG_AUTH. This will disable the Single Sign On feature.
If your prefer got to
public void authorize(Activity activity, String[] permissions,
int activityCode, final DialogListener listener)
and disable the startSingleSignOn part. It's preferable not to, because eventually Facebook will solve the problem, and you only have to put the old constant back.
EDIT
This solution raises security problems. Check Jesse Chen answer.
I faced the same problem, after spending 24 hours and a lot of search we use this method to solve my problem.
Check your Xcode project current bundle identifier
for example : com.yourcompanyname.yourappname
use the same com.yourcompanyname.yourappname bundle identifier for creating app in Facebook see attachment.
I had this problem just a few minutes ago myself on 4.0.4 and it seems to have resolved itself.
Although late, still useful:
*Here's the corerct way to do(for debug key, change accordingly for release):*
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\<User>\.android\debug.keystore" > <Drive letter>:\debug.txt
openssl sha1 -binary "<Drive letter>:\debug.txt" > "<Drive letter>:\debug_sha.txt"
openssl base64 -in "<Drive letter>:\debug_sha.txt" > "<Drive letter>:\debug_base64.txt"
The hash is in the last generated file: debug_base64.txt....open it and copy the hash.
Remember to replace "" and with your username and drive letter of your choice
When you create the key hash, you might end up with something which has the equality sign "=" at the end, like ga0RGNYHvNM5d0SLGQfpQWAPGJ8=. While Facebook gladly accepts the equality sign as part of the key hash, you have to remove it in order for it to work.
Additionally, check out the accepted answer to Android Facebook SDK 3.0 gives "remote_app_id does not match stored id" while logging in: when getting the key hash for the debug keystore, use the password "android". Otherwise the key hash will be incorrect and you will get the error specified in the question (be nice and vote up the answer there if it helped you.)
Regarding apps signed with OWN keystore:
After spending several hours solving this issue, I finally got it and want to provide an answer for those who are still suffering:
My steps:
I signed my app via eclipse with my own keystore file (NOT debug.keystore).
Via command line and known commands (keytool -exportcert -alias -keystore ~/.android/ | openssl sha1 -binary | openssl base64) I successfulluy received the key hash.
Pasted the key hash in the dev dashboard,waited a few mins -> Still the same ERROR (as specified in the question above).
i tried several differend keytools, on several jdks, etc... nothing changed.
Solution:
I turned on debuggable in manifest, turned on debugging in facebook sdk. then i signed the apk with my own keystore and uploaded it on real device.
i connected device via usb and opened DDMS perspective to see logcat on device.
I started my app and let the error message occur.
It prints out a key totally different from the key generated by keytool. I took this key from logcat, pasted it to dev dashboard and voila -> EVERYTHING WORKS
I still don't know why this happens or what is causing the wrong key, but this way it works for me.
On Debian system like ubuntu use the keytool of java found under directory /usr/lib/jvm/jdk*.*.*/bin/keytool and generate like this
/usr/lib/jvm/jdk1.7.0/bin/keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
This way you get the authentic hash key that can be put under your app hash of facebook.
Usually this problem could be solved with two check:
flag in the facebook console to publish live the facebook configuration
api key mismatches
I managed to solve the issue I was having with misconfigured for Facebook on Android by ensuring I had the correct hash key for a release version.
To get the release version hash key, find the key you used to sign the application and do the following, insert the name of your keystore alias (without brackets). If you don't know your alias this can be found by exporting your app as a signed app and the alias is on the second page of the wizard. Also insert the path to your keystore (without brackets).
keytool -exportcert -alias [Alias of your keystore] -keystore [Path to keystore] | openssl sha1 -binary | openssl base64
I did a Toast for exceptions and found it throws a key mismatch exception today added the key in the FB app page and it works fine
Also encountered this issue.
Simply go to the Facebook developers getting started page here
and follow step 4 - the thing with the command line.
Worked for me.
Enjoy.
I just had the same problem and the solution turned out to be super simple. When I created the app in the dashboard, I only had added the key hash for the android debug keystore. This all works fine if you install the app as a developer via a USB cable in this case.
Once you have an app in the Play Store, you will use a production key to sign the app. This also means, that you have to get the key hash of the production key like for the debug key and add it as a second hash to the list of native app hashes.
just to remember you how the key hash works:
keytool -exportcert -alias -keystore ~/keys/android_keystore | openssl sha1 -binary | openssl base64
Hope that helps!
I had a similar problem, but for iOS.
The solution is to do with configuring the Facebook app on the Facebook developer daskboard.
For iOS, 2 things must be done:
Enabled Facebook Login
Bundle ID must be the same as the app
It's a keystore issue..configure your eclipse to use the same keystore for which app was configured for.
I got the same error a few days ago. In my case it was due to an Android key mismatch. Here is how I fixed it if it may help you too:
Open Util.java in the Facebook SDK, set private static boolean ENABLE_LOG = true;. Now run your app and enter your email id and password. Facebook sends back a signature if there's a key mismatch. You'll find this key (signature) in LogCat. Just copy this key and paste it in the app dashboard. That should fix the problem. Remember to set private static boolean ENABLE_LOG = true; back to false.
I'm tearing my hair out trying to get push notifications to work! I'm following this tutorial to basically no avail. I've deleted xcode several times, redone the whole apple dev certificate, cleaned out my login keychain a few times. This has helped a few issues, but at the end I'm still stuck.
What I think I need to do (from reading other people's experience with this):
1) My openssl cert and key need to be talk to the apple server
2) The app id with this openssl cert has a provisioning profile associated with it.
3) The build (in xcode) needs to have the proper provisioning profile associated with it
4) The build identifier (in xcode) needs to have the same text as the application id with the provisioning profile
4) ???
As far as I can tell, all of this is ok:
My ssl certificate + key talk nicely to the apple server (ignore the error, I still get a prompt eventually):
MacBook-Pro:apple_dev_certification nflacco$ openssl s_client -connect
gateway.sandbox.push.apple.com:2195 -key xxx.pem -cert xxx.pem Enter
pass phrase for xxx.pem: CONNECTED(00000003) depth=1 /C=US/O=Entrust,
Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009
Entrust, Inc./CN=Entrust Certification Authority - L1C verify
error:num=20:unable to get local issuer certificate .....
2,3,4) When I create a new project, it never gets the right app ip (build settings->info-bundle identifier). If my provisioning profile matches 'com.xxx' then the app will always be 'com.xxx.FOO', so the default IOS Team Provisioning Profile is selected. I run the app like that, and get:
2011-10-22 22:42:45.086 VVV[3552:707] Failed to get token, error:
Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment'
entitlement string found for application" UserInfo=0x16d140
{NSLocalizedDescription=no valid 'aps-environment' entitlement string
found for application}
4 contd) I want to use my provisioning profile that uses my app id with push enabled, so I change the app identifier to 'com.xxx', and select the proper profile in the code signing option in the build menu. Install it on my iPhone, same thing :(
The only things I can think of:
My provisioning profile is not correct? I've made a new one several
times, deleted the all existing ones in xcode organizer, but this
hasn't helped.
Code is still getting signed with the Team Profile instead of my new
one? Is there a way to ensure this?
Any ideas on what I should do here? This can't be this complicated. Should I just wipe my HD and reinstall from scratch and hope it works?
You know what it was? My app id.
foo.bar is treated as foo.bar.* (which is not permitted)
you have to have foo.bar.xxx
I think for push you need an Entitlements.plist file that has an aps-environment key, with a value of "production". I just got finished getting this working (again) for my app. Some other answers here helped me get the Organizer window to pop up after I did the Archive, but then I was getting your error.
I also had to quit & restart XCode with some frequency, touch settings that didn't actually change, delete the old, pre-push certificate and add the new one, etc etc. A lot of the settings in XCode didn't actually change, but it seems like touching them caused it to start working.