macacajs / app-inspector

App-inspector is a mobile UI viewer in browser.
https://macacajs.github.io/app-inspector/
MIT License
389 stars 77 forks source link

Cannot start app-inspector: package com.macaca.android.testing is not exists #215

Closed AviramNahon closed 5 years ago

AviramNahon commented 5 years ago

Hi Guys, I don't seem to be able to run app-inspector. it gives me error: "uiautomator-client.js:38:12 [master] pid:4332 Package com.macaca.android.testing is not exists" and "app-debug.apk not found, please resolve and reinstall android driver". Can you please assist?

Environment check: $ npm i macaca-cli -g && macaca doctor Macaca was successfully installed! macaca-doctor version: 2.0.15 Node.js checklist: node env: C:\Program Files\nodejs\node.exe node version: v8.12.0 Android checklist: JAVA version is 1.8 JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_201 ANDROID_HOME is set to C:\Users\shimon\AppData\Local\Android\Sdk Platforms is set to C:\Users\shimon\AppData\Local\Android\Sdk\platforms\android-28 ADB tool is set to C:\Users\shimon\AppData\Local\Android\Sdk\platform-tools\adb.exe GRADLE_HOME is set to C:\Gradle\gradle-5.1.1\bin Installed driver list:


try app-inspector -u xxxx --verbose for more log detail.

server.js:16:12 [master] pid:5324 server start with config: { port: 5678, verbose: true, udid: '5200414eea6165b3', ip: '172.29.116.177', host: 'DESKTOP-LO5JI1F', loaded_time: '2019-01-23 01:48:12' } app-inspector.js:45:12 [master] pid:5324 server start at: http://172.29.116.177:5678 uiautomator-client.js:38:12 [master] pid:5324 Package com.macaca.android.testing is not exists,execute intsall action. uiautomator-client.js:42:14 [master] pid:5324 C:\Users\shimon\AppData\Roaming\npm\node_modules\app-inspector\node_modules\uiautomatorwd\app\build\outputs\apk\app-debug.apk not found, please resolve and reinstall android driver Error: >> uiautomator-client.js:42:14 [master] pid:5324 C:\Users\shimon\AppData\Roaming\npm\node_modules\app-inspector\node_modules\uiautomatorwd\app\build\outputs\apk\app-debug.apk not found, please resolve and reinstall android driver at Logger.error (C:\Users\shimon\AppData\Roaming\npm\node_modules\app-inspector\node_modules\xlogger\lib\xlogger.js:169:9) at UIAutomator.init (C:\Users\shimon\AppData\Roaming\npm\node_modules\app-inspector\node_modules\uiautomatorwd\lib\uiautomator-client.js:42:14) at UIAutomator.init.throw () at onRejected (C:\Users\shimon\AppData\Roaming\npm\node_modules\app-inspector\node_modules\co\index.js:81:24) at at process._tickCallback (internal/process/next_tick.js:189:7)

macaca-bot commented 5 years ago

This is the translated issue:


Cannot start app-inspector: package com.macaca.android.testing is not exists

Hi Guys, I don't seem to be able to run app-inspector. It gives me error: "uiautomator-client.js:38:12 [master] pid:4332 Package com.macaca.android.testing is not exists" and "app-debug.apk not found, please resolve and reinstall android driver" . Can you please assist?

Environment check: $ npm i macaca-cli -g && macaca doctor Macaca was successfully installed!   Macaca-doctor version: 2.0.15   Node.js checklist:   Node env: C:\Program Files\nodejs\node.exe   Node version: v8.12.0   Android checklist:   JAVA version is 1.8   JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_201   ANDROID_HOME is set to C:\Users\shimon\AppData\Local\Android\Sdk   Platforms is set to C:\Users\shimon\AppData\Local\Android\Sdk\platforms\android-28   ADB tool is set to C:\Users\shimon\AppData\Local\Android\Sdk\platform-tools\adb.exe   GRADLE_HOME is set to C:\Gradle\gradle-5.1.1\bin   Installed driver list:


try app-inspector -u xxxx --verbose for more log detail.

server.js:16:12 [master] pid:5324 server start with config:  { port: 5678,   Verbose: true,   Udid: '5200414eea6165b3',   Ip: '172.29.116.177',   Host: 'DESKTOP-LO5JI1F',   Loaded_time: '2019-01-23 01:48:12' } app-inspector.js:45:12 [master] pid:5324 server start at: http://172.29.116.177:5678 uiautomator-client.js:38:12 [master] pid:5324 Package com.macaca.android.testing is not exists,execute intsall action. uiautomator-client.js:42:14 [master] pid:5324 C:\Users\shimon\AppData\Roaming\npm\node_modules\app-inspector\node_modules\uiautomatorwd\app\build\outputs\apk\app- Debug.apk not found, please resolve and reinstall android driver Error: >> uiautomator-client.js:42:14 [master] pid:5324 C:\Users\shimon\AppData\Roaming\npm\node_modules\app-inspector\node_modules\uiautomatorwd\app\build\outputs\apk\ App-debug.apk not found, please resolve and reinstall android driver     At Logger.error (C:\Users\shimon\AppData\Roaming\npm\node_modules\app-inspector\node_modules\xlogger\lib\xlogger.js:169:9)     At UIAutomator.init (C:\Users\shimon\AppData\Roaming\npm\node_modules\app-inspector\node_modules\uiautomatorwd\lib\uiautomator-client.js:42:14)     At UIAutomator.init.throw ()     At onRejected (C:\Users\shimon\AppData\Roaming\npm\node_modules\app-inspector\node_modules\co\index.js:81:24)     At     At process._tickCallback (internal/process/next_tick.js:189:7)

AviramNahon commented 5 years ago

I have also tried to run as suggested in another issue: $ cd ...npm\node_modules\app-inspector\node_modules\uiautomatorwd $ node ./scripts/build.js and got this:

(node:6868) UnhandledPromiseRejectionWarning: ,Starting a Gradle Daemon (subsequent builds will be faster)

Configure project :app NDK is missing a "platforms" directory. If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to ...l\Android\Sdk\ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

File C:\Users\shimon.android\repositories.cfg could not be loaded. Checking the license for package Android SDK Build-Tools 25.0.2 in ...\Android\Sdk\licenses Warning: License for package Android SDK Build-Tools 25.0.2 not accepted. Checking the license for package Android SDK Platform 26 in ...\Android\Sdk\licenses Warning: License for package Android SDK Platform 26 not accepted. , FAILURE: Build failed with an exception.

BUILD FAILED in 1m 43s

(node:6868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:6868) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

paradite commented 5 years ago

You need to accept the licenses as stated in the error. Refer to the docs on how to setup Android environment: https://macacajs.github.io/guide/environment-setup.html#android

Then npm uninstall -g app-inspector and npm i -g app-inspector

AviramNahon commented 5 years ago

Thanks, the problem was not the licenses (I already accepted all before). the problem was that I probably missed installing macaca-android before installing app-inspector. Now the server is up without error but the view source is empty... gives only: . I will open a new issue on that.