我有一个使用Cordova的Meteor应用程序可在Android手机上运行。我使用ADB在手机上运行该应用程序而无需构建APK。
首先尝试正确构建应用程序,然后将其显示在手机上。多数情况下,在第二次尝试时构建失败,并且手机上没有任何显示。杀死终端,删除app-debug.apk并重新编译大多数时间可以解决此问题。
这是错误输出:
=> Errors executing Cordova commands:
While running Cordova app for platform Android with options --buildConfig, /app/.meteor/local/cordova-build/build.json,--device:
Error: Command failed: /app/.meteor/local/cordova-build/platforms/android/cordova/run --buildConfig /app/.meteor/local/cordova-build/build.json --device { Error: adb: Command failed with exit code 1 Error output:
adb: failed to install /app/.meteor/local/cordova-build/platforms/android/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl786293388.tmp/base.apk using APK Signature Scheme v2: SHA-256 digest of contents did not verify]
at ChildProcess.whenDone (/app/.meteor/local/cordova-build/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) stderr: 'adb: failed to install /app/.meteor/local/cordova-build/platforms/android/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl786293388.tmp/base.apk using APK Signature Scheme v2: SHA-256 digest of contents did not verify]', code: 1 } 'Error: adb: Command failed with exit code 1 Error output:\nadb: failed to install /app/.meteor/local/cordova-build/platforms/android/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl786293388.tmp/base.apk using APK Signature Scheme v2: SHA-256 digest of contents did not verify]\n
at ChildProcess.whenDone (/app/.meteor/local/cordova-build/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)\n
at emitTwo (events.js:126:13)\n
at ChildProcess.emit (events.js:214:7)\n
at maybeClose (internal/child_process.js:915:16)\n
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)'
at ChildProcess.exitCallback (/tools/utils/processes.js:151:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
/.meteor/packages/meteor-tool/.1.8.1.ani1yi.p0f9s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/fibers.js:90
return fn.apply(this, arguments);