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

[Windows] No signature files found in META-INF. Cannot proceed. #802

Open
d-konovalov opened this issue Jan 17, 2017 · 27 comments
Open

[Windows] No signature files found in META-INF. Cannot proceed. #802

d-konovalov opened this issue Jan 17, 2017 · 27 comments

Comments

@d-konovalov
Copy link

When I run this command:
calabash-android build BuildName.apk
on mac all works as expected
but if I try to do it on windows I get next error:

C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:188:in `block (2 levels) in fingerprint_from_apk': No signature files found in META-INF. Cannot proceed. (RuntimeError) from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:170:in `chdir' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:170:in `block in fingerprint_from_apk' from C:/Ruby22-x64/lib/ruby/2.2.0/tmpdir.rb:88:in `mktmpdir' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:169:in `fingerprint_from_apk' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/bin/calabash-android-build.rb:2:in `calabash_build' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/bin/calabash-android:72:in `<top (required)>' from C:/Ruby22-x64/bin/calabash-android:23:in `load' from C:/Ruby22-x64/bin/calabash-android:23:in `<main>'

Please help me to find what I do wrong
Best regards

@TobiasRoikjer
Copy link
Contributor

The application is not signed, you need to run the resign command. e.g. calabash-android resign <apk>. (I also heavily recommend you use bundler to manage you gem versions)

@d-konovalov
Copy link
Author

d-konovalov commented Jan 17, 2017

Thank you for super fast response @TobiasRoikjer
once i've tried to execute command you just provided I get this error message:

C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/java_keystore.rb:60:in `sign_apk': Could not sign app: C:/Users/Test/AppData/Local/Temp/d20170117-6456-w7dzrc/unsigned.apk (RuntimeError)
 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:164:in `sign_apk'
 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:119:in `block in resign_apk'
 	from C:/Ruby22-x64/lib/ruby/2.2.0/tmpdir.rb:88:in `mktmpdir'
 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:113:in `resign_apk'
 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/bin/calabash-android:133:in `<top (required)>'
 	from C:/Ruby22-x64/bin/calabash-android:23:in `load'
 	from C:/Ruby22-x64/bin/calabash-android:23:in `<main>'
 2017-01-17 13:25:24 - Resign apk
 DEBUG: Setting Android SDK location to $ANDROID_HOME
 DEBUG: Android SDK location set to 'C:\Users\Test\AppData\Local\Android\Sdk'
 DEBUG: Set aapt path to 'C:\Users\Test\AppData\Local\Android\Sdk/build-tools/25.0.2/aapt.exe'
 DEBUG: Set zipalign path to 'C:\Users\Test\AppData\Local\Android\Sdk/build-tools/25.0.2/zipalign.exe'
 DEBUG: Set adb path to 'C:\Users\Test\AppData\Local\Android\Sdk/platform-tools/adb.exe'
 DEBUG: Set android jar path to 'C:\Users\Test\AppData\Local\Android\Sdk/platforms/android-25/android.jar'
 DEBUG: Setting Java SDK location from HKEY_LOCAL_MACHINE SOFTWARE\JavaSoft\Java Development Kit\1.8
 DEBUG: Java SDK location set to 'C:\Program Files\Java\jdk1.8.0_111'
 DEBUG: Found java on PATH
 DEBUG: Set java path to '\Program Files\Java\jre1.8.0_111\bin/java.exe'
 DEBUG: Found keytool on PATH
 DEBUG: Set keytool path to '\Program Files\Java\jre1.8.0_111\bin/keytool.exe'
 DEBUG: Found jarsigner on PATH
 DEBUG: Set jarsigner path to '\Program Files\Java\jdk1.8.0_111\bin/jarsigner.exe'

@TobiasRoikjer TobiasRoikjer reopened this Jan 17, 2017
@TobiasRoikjer
Copy link
Contributor

@d-konovalov What is the full ouput (including the command you have executed)?

@d-konovalov
Copy link
Author

The next line is attempt to build it calabash-android build <apk-file>

@TobiasRoikjer
Copy link
Contributor

@d-konovalov Run using DEBUG=1 bundle exec calabash-android resign <apk> -v

Look for the line below Signing using the digest algorithm: .
Try executing that command on its own

@d-konovalov
Copy link
Author

@TobiasRoikjer
It seems that resign worked without errors

[split_1] DEBUG=1 bundle exec calabash-android resign Music.Droid.YouSee_3.5.0.380.apk -v
[split_1] cp ./keystores/yousee_calabash_settings ./.calabash_settings
[split_1] bundle exec calabash-android build Music.Droid.YouSee_3.5.0.380.apk
[split_1] C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:188:in `block (2 levels) in fingerprint_from_apk': No signature files found in META-INF. Cannot proceed. (RuntimeError)
[split_1] 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:170:in `chdir'
[split_1] 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:170:in `block in fingerprint_from_apk'
[split_1] 	from C:/Ruby22-x64/lib/ruby/2.2.0/tmpdir.rb:88:in `mktmpdir'
[split_1] 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:169:in `fingerprint_from_apk'
[split_1] 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/bin/calabash-android-build.rb:2:in `calabash_build'
[split_1] 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/bin/calabash-android:72:in `<top (required)>'
[split_1] 	from C:/Ruby22-x64/bin/calabash-android:23:in `load'
[split_1] 	from C:/Ruby22-x64/bin/calabash-android:23:in `<main>'
[split_1] 2017-01-17 16:25:51 - Signature files:

But as you can see the initial error message is still available

Thanks

@TobiasRoikjer
Copy link
Contributor

You have to build the the same .calabash_settings as the ones you use to resign it.

@d-konovalov
Copy link
Author

hm
you mean I should run resign command after I copy .calabash_settings file?

@TobiasRoikjer
Copy link
Contributor

Yes. Calabash has to have a server (created using build) signed used the same credentials as the app under test (resigned using resign)

@d-konovalov
Copy link
Author

I've changed order of these actions but the output is the same (

[split_1] cp ./keystores/yousee_calabash_settings ./.calabash_settings
[split_1] DEBUG=1 bundle exec calabash-android resign Music.Droid.YouSee_3.5.0.380.apk -v
[split_1] bundle exec calabash-android build Music.Droid.YouSee_3.5.0.380.apk
[split_1] C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:188:in `block (2 levels) in fingerprint_from_apk': No signature files found in META-INF. Cannot proceed. (RuntimeError)
[split_1] 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:170:in `chdir'
[split_1] 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:170:in `block in fingerprint_from_apk'
[split_1] 	from C:/Ruby22-x64/lib/ruby/2.2.0/tmpdir.rb:88:in `mktmpdir'
[split_1] 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/helpers.rb:169:in `fingerprint_from_apk'
[split_1] 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/bin/calabash-android-build.rb:2:in `calabash_build'
[split_1] 	from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/bin/calabash-android:72:in `<top (required)>'
[split_1] 	from C:/Ruby22-x64/bin/calabash-android:23:in `load'
[split_1] 	from C:/Ruby22-x64/bin/calabash-android:23:in `<main>'
[split_1] 2017-01-17 16:54:28 - Signature files:

@TobiasRoikjer
Copy link
Contributor

@d-konovalov Unzip the apk after running resign, and look into the directory named META-INF, what do you see?

@d-konovalov
Copy link
Author

I can see MANIFEST.MF, CERT.SF and CERT.RSA files
i just did resign locally and saw valid output without any errors
the errors i posted here copied from remote run (via jenkins) from the same machine
after resigning locally calabash-android build <apk> worked without any errors :(

@TobiasRoikjer
Copy link
Contributor

To confirm, on the CI machine, you resigned the app, and on the CI machine, you unzipped the app, and saw those files in the META-INF directory?

@d-konovalov
Copy link
Author

Yep
I did it manually on that machine and succeeded
but when i try to resign it remotely with script I see the error again (after resign step)

@TobiasRoikjer
Copy link
Contributor

And you are doing it from the same directory and user as the CI script is running as?

@d-konovalov
Copy link
Author

The directory is the same but I'm not sure about the user

@d-konovalov
Copy link
Author

This one is still happens when triggered by CI

C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/calabash-android-0.9.0/lib/calabash-android/java_keystore.rb:60:in `sign_apk': Could not sign app: C:/Users/Test/AppData/Local/Temp/d20170117-7352-1c81xzp/unsigned.apk (RuntimeError)

@TobiasRoikjer
Copy link
Contributor

To confirm, that happens when you execute build, and not resign?

@d-konovalov
Copy link
Author

d-konovalov commented Jan 17, 2017 via email

@andreroggeri
Copy link

Probably you're using the JDK 151 or 152.

These versions of JDK changed the way that keytool works.

The quick fix for this is downgrading the JDK to 144 (previous version). And your error should be fixed

@ruttuk
Copy link

ruttuk commented Sep 7, 2018

Hello, I am having the exact same issue. I've tried downgrading to JDK 144 and still I see the following:

bundle exec calabash-android run kingmaker.apk
WARNING: skipped META-INF/CERT.RSA as unsafe
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:188:in `block (2 levels) in fingerprint_from_apk': No signature files found in META-INF. Cannot proceed. (RuntimeError)

@KGMSathish
Copy link

KGMSathish commented Sep 11, 2018

Guys i'm also facing same issue, after resigning the apk(resigning will be success)

Resign

D:\test>bundle exec calabash-android resign app-staging.apk

D:\test>

When i do run/build

D:\test>bundle exec calabash-android run app-staging.apk
No test server found for this combination of app and calabash version. Recreating test server.
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
WARNING: skipped META-INF/CERT.RSA as unsafe
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:188:in block (2 levels) in fingerprint_from_apk': No s re files found in META-INF. Cannot proceed. (RuntimeError) from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:170:in chdir'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:170:in block in fingerprint_from_apk' from C:/Ruby23-x64/lib/ruby/2.3.0/tmpdir.rb:89:in mktmpdir'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:169:in fingerprint_from_apk' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/bin/calabash-android-build.rb:2:in calabash_build'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:107:in build_test_server_if_needed' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/bin/calabash-android-run.rb:16:in calabash_run'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/bin/calabash-android:86:in <top (required)>' from C:/Ruby23-x64/bin/calabash-android:22:in load'
from C:/Ruby23-x64/bin/calabash-android:22:in `

'

@ruttuk
Copy link

ruttuk commented Sep 11, 2018

@KGMSathish try downgrading the version of calabash-android to 0.9.5 and rubyzip to 1.2.1.

@SathishKadavanna
Copy link

@ruttuk Thanks a tonne, i removed ruby fully & installed Ruby 2.5.1, RubyZip 1.2.1, Calabash-Android 0.9.5
With this its working fine. Thanks @ruttuk 💯

@shahbaz-qaiser-10p
Copy link

@TobiasRoikjer facing the same issue can you help me with it?

@GiuseppeGiacoppo
Copy link

@shahbaz-qaiser-10p
I had problems even with ruttuk's solution.
On Windows I solved installing Ruby+Devkit instead of Ruby alone. Then created a Gemfile specifying RubyZip 1.2.1 and calabash-android 0.9.5 and it worked.

@JoeSSS
Copy link
Contributor

JoeSSS commented May 13, 2021

hey does it still happen with 0.9.22 version of the gem?

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

9 participants