首页 > 解决方案 > 在 META-INF 中找不到签名文件。无法继续(运行时错误)

问题描述

我正在尝试使用 calabash-android 在 android studio 的手机上启动测试服务器。我是新手,感谢教程。

我下载了 java、ruby、calabash-android,设置环境变量,在 中创建了一个密钥库,在我的文件夹中.calabash-settings有一个文件。.debug-keystore.android

我不知道这个问题是什么我可以正常运行,bundle exec calabash-android resign app-debug.apk但是当我这样做时bundle exec calabash-android run app-debug.apk,我收到以下错误消息。我显然错过了一些东西,但我不确定是什么:

C:\Users\Dell\AndroidStudioProjects\Calabash>bundle exec calabash-android build app-debug.apk
WARNING: skipped META-INF/CERT.RSA as unsafe
Traceback (most recent call last):
        8: from C:/Ruby26-x64/bin/calabash-android:23:in `<main>'
        7: from C:/Ruby26-x64/bin/calabash-android:23:in `load'
        6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/bin/calabash-android:76:in `<top (required)>'
        5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/bin/calabash-android-build.rb:2:in `calabash_build'
        4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/lib/calabash-android/helpers.rb:162:in `fingerprint_from_apk'
        3: from C:/Ruby26-x64/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
        2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/lib/calabash-android/helpers.rb:163:in `block in fingerprint_from_apk'
        1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/lib/calabash-android/helpers.rb:163:in `chdir'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/lib/calabash-android/helpers.rb:177:in `block (2 levels) in fingerprint_from_apk': **No signature files found in META-INF. Cannot proceed. (RuntimeError)**

标签: rubycalabashcalabash-android

解决方案


我在 ruby​​ (v3.0.2p107) 和 calabash (v0.9.22) 的最新可用版本中遇到了同样的问题。

我通过使用“bundle install”命令并使用以前版本指定 GemFile 来避免这个问题。

    # Contents of Gemfile
    source "https://rubygems.org"
    
    ruby "2.5.1"

    gem 'calabash-android', '0.9.5'
    gem 'cucumber'
    gem 'rexml'
    gem 'rubyzip', '1.2.1'

您可能想参考提出的类似问题,例如https://github.com/calabash/calabash-android/issues/802


推荐阅读