Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when trying to start logKitty for React-Native Android Project

I have run this logger in other projects without issue running react-native log-android why is the logger failing in this project folder. These are mostly out of box react-native init NewProjects with very few changes. So im surprised this one project I can't run the logger in. I like the cmd logger better. Its faster than running the one in chrome.

λ react-native log-android
info Starting logkitty
The filename, directory name, or volume label syntax is incorrect.
error Command failed: 'C:\Users\{UserPIN}\AppData\Local\Android\Sdk/platform-tools/adb' logcat -c
The filename, directory name, or volume label syntax is incorrect.
. Run CLI with --verbose flag for more details.
Error: Command failed: 'C:\Users\{UserPIN}\AppData\Local\Android\Sdk/platform-tools/adb' logcat -c
The filename, directory name, or volume label syntax is incorrect.

    at spawnLogcatProcess (c:\ws\mobile2\ReactRegLoc\node_modules\logkitty\build\android\adb.js:36:11)
    at runAndroidLoggingProcess (c:\ws\mobile2\ReactRegLoc\node_modules\logkitty\build\android\adb.js:21:10)
    at logkitty (c:\ws\mobile2\ReactRegLoc\node_modules\logkitty\build\api.js:137:85)    at Object.logAndroid [as func] (c:\ws\mobile2\ReactRegLoc\node_modules\@react-native-community\cli-platform-android\build\commands\logAndroid\index.js:37:44)
    at Command.handleAction (c:\ws\mobile2\ReactRegLoc\node_modules\react-native\node_modules\@react-native-community\cli\build\cliEntry.js:160:21)
    at Command.listener (c:\ws\mobile2\ReactRegLoc\node_modules\commander\index.js:315:8)
    at Command.emit (events.js:189:13)
    at Command.parseArgs (c:\ws\mobile2\ReactRegLoc\node_modules\commander\index.js:651:12)
    at Command.parse (c:\ws\mobile2\ReactRegLoc\node_modules\commander\index.js:474:21)
    at setupAndRun (c:\ws\mobile2\ReactRegLoc\node_modules\react-native\node_modules\@react-native-community\cli\build\cliEntry.js:210:24)
like image 424
Puerto Avatar asked Aug 19 '19 13:08

Puerto


1 Answers

It seems broken for right now, but a temporary fix is to change the file in your node-modules folder.

In node_modules/logkitty/build/android/adb.js

Change line 29 to:

return process.env.ANDROID_HOME ? `${process.env.ANDROID_HOME}\\platform-tools\\adb` : 'adb';

And change line 34 to:

(0, _child_process.execSync)(`${adbPath} logcat -c`);
like image 103
Reid Avatar answered Nov 08 '22 09:11

Reid