I have a problem with one of my jenkins build.
I have configured in my global credentials, a keystore for one of my android build. This keystore is needed for when I have to sign my apk in order to distribute my app on Google Play for example.
So in the job, I have configured a Secret file binding to allow jenkins to copy the keystore file to a temporary location and sets a variable, let's call it SECRET_PATH, to that location. I can then provide gradle with the value of this variable on the command line when invoking the gradle script (in the switches section).
But then the build fails each time :
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':myapp:packageRelease'.
> Failed to read key ******** from store "/home/jenkins/slave/secretFiles/3607aab3-6e27-497a-b198-7d9a3aeb2913/keystore": Keystore was tampered with, or password was incorrect
it is as if the location /home/jenkins/slave/secretFiles/3607aab3-6e27-497a-b198-7d9a3aeb2913/keystore didn't even exist.
In the job configuration, the help tip on the Bindings sections also mentions this :
Warning: if the master or slave node has multiple executors, any other build running concurrently on the same node will be able to read the contents of this file.
It is exactly as if another concurrent build were running and deleted the location where the keystore was. This is really weird.
One more thing, I am using a master/slave topology where everything is dockerized. Not sure the docker itself is involved though. I think it's purely a Jenkins issue but I am giving this information so that you guys have some context.
Have you guys ever experienced this weird behaviour where jenkins seems to be unable to "resolve" the secret file bindings ?
Any help would be really appreciated.
thanks in advance,
Failed to read key ******** from store "/home/jenkins/slave/secretFiles/3607aab3-6e27-497a-b198-7d9a3aeb2913/keystore": Keystore was tampered with, or password was incorrect
it is as if the location /.../keystore didn't even exist.
No, the error message is correct — the file does exist, but most likely the store password or key password you are providing is incorrect.
If the keystore did not exist, you would get an error something like:
File '/.../release.keystore' specified for property 'signingConfig.storeFile' does not exist.
You can double check this by running file $SECRET_PATH/keystore, or ls -l $SECRET_PATH/keystore, or using keytool or something similar.
You don't mention injecting the keystore and key password(s) at all into the job — how are you doing that?
First make sure that building and signing the release version works as expected with Gradle from the command line.
Then you could try doing the same in Jenkins, by passing in the filename and password via the Gradle step (though this isn't a great idea if you're using the Job Config History plugin, for example).
Once that works, you can use the credential binding plugin to inject the file, and to inject the password.
Related
After updating my dev environment by installing some new android-sdk's and changing java versions, my xamarin.uitest project started failing to install the apk for testing.
The exception I am getting is "Fingerprints didn't match.", which based on the stack trace is being thrown by the method at
Xamarin.UITest.Shared.Android.AndroidTestServerFactory.BuildTestServer(ApkFile appApkFile, KeyStore keyStore, ArtifactFolder artifactFolder, Assembly sharedAssembly)
What do I need to do to resolve this?
The issue is regarding the dev keystore, which the uitest framework is using to sign the apk.
While I do not know the details, the solution I found was to remove the keystores from the uitest temp folder. For me, the location of this is temp directory was at C:\Users%username%\AppData\Local\Temp\uitest.
In the 'uitest' directory, there are multiple directories as shown:
What I did was removed the directories that started with 'a-', and after which was able to run the test successfully. This I assume created a new keystore.
I created a key for my application on my laptop and released my application. Now I just copied that key into a flash and now I want to reuse it again, But I get this error:
Error:Execution failed for task ':app:packageRelease'.
> com.android.ide.common.signing.KeytoolException: Failed to read key key0 from store "E:\Rasad\Key\RasadKey.jks": Keystore was tampered with, or password was incorrect
I just test this path again with a new key and it happened again!
What is the problem?
Thankyou for your answers.
Copy the ".jks" file and enter the same password you have used before. When generating signed apk, choose existing instead of new. Hope it helps
It's very likely that you have provided either the wrong key store password, or the wrong key password. There's an easy way to check with keytool:
Check android keystore keypass for correctness
I am new to android.
i get this error when i try to upload update of my app to google play.
Failed to run aapt dump badging:W/ResourceType(19538): Bad resource table: header size 0x708b or total size 0x2f2432a is larger than data size 0x1ce1c
ERROR: AndroidManifest.xml is corrupt
i tried ALMOST VERYTHING google fixes.but nothing works.
please help.
It gave me that 'uploading in debuggable mode' thiny too but i managed to fix it.
sorry about my bad english.
I went through the same problem recently (with the very similar error message) and I also had a lot of trouble to solve, but finally I got it like this:
I used the PhoneGap Builder to generate the APK (so I recommend using the same one); Remembering that to test manages the APK with the same blank key (it's the default markup);
After generating, I used Apk-Signer (https://shatter-box.com/knowledgebase/android-apk-signing-tool-apk-signer/) to generate the key (.keystore) - this package serves, too , To sign and align the application; However, for that case I used ONLY to generate the key;
Go back to the Phone Gap, in the Android options, select 'add a key ...', then select your keystore generated in APK-Signer, and activate the rebuild;
Ready! Now just download the APK, go to google play and be happy.
I ran into a similar problem not so long ago it turned out to be an issue with #+id
A similar question has been asked before and got me through my problem, I will link the post as it is very informative.
Android style Resources compile (aapt) failing : Bad resource table: header size 0xc
Hope this helps you, wish you the best of luck.
I'm new to android too, and I had the same problem, and what worked for me was as simple as :
Zipalign the apk file by a tool called "Advanced APK tool" (download it from xda forum)
then reupload apk file to store without any problem detected,
Best of luck!
Try using a latest version of aapt, from your Android SDK directory,
<Android_SDK_directory>/build-tools/<build_tools_version>/aapt
I am trying to upload my library, ListBuddies, to maven. To do that I am using the gradle-mvn-push github project of #ChrisBanes . I follow all the steps that he mentioned on his repo plus some others that are needed before that repo is used:
I opened a Jira issue and I waited until It got resolved
I have created GPG keys
I configurate ListBuddies's build.gradle files and the gradle.properties
I have created another local gradle.properties at "/Users/jpardogo/.gradle/gradle.properties"
local gradle.properties file (signing keys are only need for release so should not be a problem for the SNAPSHOT):
//These are the username/password that I use for:
//[JIRA](https://issues.sonatype.org)
//and [NEXUS](https://oss.sonatype.org
NEXUS_USERNAME=jpardogo1
NEXUS_PASSWORD=jira-pass
//This is the key ID that I obtain doing "gpg --list-keys" on the terminal
signing.keyId=my-keyid
//This is the paraphrase I set when I first created the key
signing.password=my-paraphrase
//That's the path to my secret key ring
signing.secretKeyRingFile=/Users/jpardogo/.gnupg/secring.gpg
Look like everything is setup properly but when I do:
gradle clean build uploadArchives
At the end I receive code ERROR 401:
:library:uploadArchives
Uploading: com/jpardogo/listbuddies/library/1.0.0-SNAPSHOT/library-1.0.0-20140209.151716- 1.aar to repository remote at https://oss.sonatype.org/content/repositories/snapshots/
Transferring 67K from remote
:library:uploadArchives FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':library:uploadArchives'.
> Could not publish configuration 'archives'
> Error deploying artifact 'com.jpardogo.listbuddies:library:aar': Error deploying artifact: Failed to transfer file: https://oss.sonatype.org/content/repositories/snapshots/com/jpardogo/listbuddies/library/1.0.0-SNAPSHOT/library-1.0.0-20140209.151716-1.aar. Return code is: 401
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I have been looking for an answer the whole day of yesterday and today as well but I couldn't solve it. The error 401 reason is good explain in here, but I couldn't solved anything and I also read that It could be due user permissions problem although I register on Jira as the guide says.
I hope you can help me with that and If you need any more information, please let me know. Thanks.
EDIT: I want to update the question with the link to the jira ticket and its comments.
I finally solved it. All the configuration was ok. The problem was on the file gradle.properties. Because I copy paste the structure of the file, a hidden tabulation reminded next to the NEXUS_USERNAME, so the username actually was being sent with the tabulation and I was receiving a authentication error.
Sometimes things are more simple than you think, and you don't see them. The first thing I will do the next time will be to check the format of the files.
I had exactly the same problem, and the reason was: my password (generated) contained a backslash \.
Solution: Backslashes need to be escaped in gradle.properties!
Example:
ossrhPassword=partBeforeBackslash\\\\partAfterBackslash
instead of:
ossrhPassword=partBeforeBackslash\partAfterBackslash
For me the problem was that I was uploading a version that already exists in the rep. The solution was just to change the 'version' in the build.gradle file.
i am trying to build apk from command line with ant. I am able to create build in debug mode while getting this error when i run in release mode for signing the apk file with the key store generated.
my local.properties file look like this
sdk.dir=E:\\_WorkArea\\adt-bundle-windows-x86\\sdk
key.store=C:\Users\\l.keystore
key.alias=tys
key.store.password=tr
key.alias.password=tre
D:\Android-Sdks\tools\ant\build.xml:1132: The following error occurred
while executing this line:
D:\Android-Sdks\tools\ant\build.xml:1144: Value for 'keystore' is not
valid. It must resolve to a single path
i got the same problem with you.
you miss the "\" at key.store value
Note:
key.store=C:\\Users\\l.keystore
#cavallo answer is incorrect
It is not at all mandatory for keystore to be in the same folder.
The solution for you might have worked because the relative path would contain any slashes to be escaped.
Don't mislead others by accepting wrong answers of yours.
This was resolved by the keystore and the project has to be on the same folder... thats what it means by saying It must resolve to a single path..resolved myself....kudos
I had this message as well. It turned out my problem was actually in the ant.properties file where the keystore path contained an error. Changing that fixed it.