HELP: Problems with `meteor run android` on mac. ANY IDEAS?

Hi guys,

I have problems getting meteor run android to work.

Yes, I have followed the guide https://guide.meteor.com/mobile.html.

I have installed Android Studio with

  • Android SDK 28
  • Android SDK Build-Tools 28.0.3
  • Android SDK Plattofrm-Tools 29.0.6
  • Android SDK Command Line (latest)

My operation system Osx 10.14.4

Steps to reproduce with more data

# versions
meteor --version  # Meteor 1.10.1
java -version  # java version "1.8.0_65"

# reproduce
# create react project
meteor create --react minimal-setup
cd minimal-setup

# enable android
meteor add-plattform android

# run android emulator
meteor run android


This is the error I get in SHORT:

TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null

This is the LONG log

meteor run android
[[[[[ ~/Projects/android-test/minimal-setup ]]]]]

=> Started proxy.                             
=> Started MongoDB.                                                                
Checking Java JDK and Android SDK versions   -                                     
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/thebarty/Library/Android/sdk (DEPRECATED)
=> Started your app.                          
                                              
=> App running at: http://localhost:3000/     
Starting a Gradle Daemon (subsequent builds will be faster)

BUILD SUCCESSFUL in 6s
1 actionable task: 1 executedulator          /
> Task :app:cdvCreateAssetManifestr          |
> Task :app:preBuild
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :CordovaLib:checkDebugManifest
> Task :CordovaLib:processDebugManifest      /
> Task :app:preDebugBuild
> Task :CordovaLib:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :CordovaLib:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript
> Task :app:checkDebugManifest
> Task :app:generateDebugBuildConfig
> Task :app:prepareLintJar
> Task :app:generateDebugSources
> Task :CordovaLib:compileDebugRenderscript
> Task :CordovaLib:generateDebugBuildConfig
> Task :CordovaLib:generateDebugResValues
> Task :CordovaLib:generateDebugResources
> Task :CordovaLib:packageDebugResources
> Task :CordovaLib:generateDebugRFile        \
> Task :CordovaLib:prepareLintJar
> Task :CordovaLib:generateDebugSources
> Task :CordovaLib:javaPreCompileDebug
> Task :CordovaLib:compileDebugJavaWithJavac \
> Task :CordovaLib:processDebugJavaRes NO-SOURCE
> Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
> Task :app:javaPreCompileDebug
> Task :app:mainApkListPersistenceDebug
> Task :app:generateDebugResValues
> Task :app:generateDebugResources
> Task :app:mergeDebugResources
> Task :app:createDebugCompatibleScreenManifests
> Task :app:processDebugManifest
> Task :app:processDebugResourcesor          /
   Starting app on Android Emulator          |
> Task :app:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.

> Task :app:compileDebugNdk NO-SOURCE
> Task :app:compileDebugSources
Note: Recompile with -Xlint:unchecked for details.
> Task :app:mergeDebugShaders
> Task :app:compileDebugShaders
> Task :app:generateDebugAssets
> Task :CordovaLib:mergeDebugShaders
> Task :CordovaLib:compileDebugShaders
> Task :CordovaLib:generateDebugAssets
> Task :CordovaLib:packageDebugAssets
> Task :app:mergeDebugAssets
> Task :app:validateSigningDebugtor          /
> Task :app:signingConfigWriterDebug
> Task :app:transformClassesWithDexBuilderForDebug
> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug
> Task :app:transformDexArchiveWithDexMergerForDebug
> Task :app:mergeDebugJniLibFolders
> Task :CordovaLib:compileDebugNdk NO-SOURCE
> Task :CordovaLib:mergeDebugJniLibFolders
> Task :CordovaLib:transformNativeLibsWithMergeJniLibsForDebug
> Task :CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug
> Task :app:transformNativeLibsWithMergeJniLibsForDebug
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:transformResourcesWithMergeJavaResForDebug
> Task :app:packageDebugid Emulator          \
> Task :app:assembleDebug
> Task :app:cdvBuildDebug

BUILD SUCCESSFUL in 11s
43 actionable tasks: 43 executed
Checking Java JDK and Android SDK versions   /
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/thebarty/Library/Android/sdk (DEPRECATED)
%% No target specified and no devices found, deploying to emulator
%% No emulator specified, defaulting to Pixel_2_API_28
=> Errors executing Cordova commands:         
                                              
   While running Cordova app for platform Android with options
   --buildConfig,/Users/thebarty/Projects/android-test/minimal-setup/.meteor/local/cordova-build/build.json,--emulator:
   TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
   at validateString (internal/validators.js:117:11)
   at Object.dirname (path.js:1128:5)
   at /Users/thebarty/Projects/android-test/minimal-setup/.meteor/local/cordova-build/platforms/android/cordova/lib/emulator.js:294:37
   at _fulfilled (/Users/thebarty/Projects/android-test/minimal-setup/.meteor/local/cordova-build/node_modules/q/q.js:854:54)
   at /Users/thebarty/Projects/android-test/minimal-setup/.meteor/local/cordova-build/node_modules/q/q.js:883:30
   at Promise.promise.promiseDispatch (/Users/thebarty/Projects/android-test/minimal-setup/.meteor/local/cordova-build/node_modules/q/q.js:816:13)
   at /Users/thebarty/Projects/android-test/minimal-setup/.meteor/local/cordova-build/node_modules/q/q.js:624:44
   at runSingle (/Users/thebarty/Projects/android-test/minimal-setup/.meteor/local/cordova-build/node_modules/q/q.js:137:13)
   at flush (/Users/thebarty/Projects/android-test/minimal-setup/.meteor/local/cordova-build/node_modules/q/q.js:125:13)
   at processTicksAndRejections (internal/process/task_queues.js:79:11)
   => awaited here:
   at Function.Promise.await
   (/Users/thebarty/.meteor/packages/static-html/.1.2.2.10tinsq++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:35:12)
   at /tools/cordova/project.js:314:7
   at
   /Users/thebarty/.meteor/packages/static-html/.1.2.2.10tinsq++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:32:39
   => awaited here:
   at Function.Promise.await
   (/Users/thebarty/.meteor/packages/static-html/.1.2.2.10tinsq++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:35:12)
   at CordovaProject.runCommands (/tools/cordova/project.js:842:22)
   at /tools/cordova/project.js:312:10
   at
   /Users/thebarty/.meteor/packages/static-html/.1.2.2.10tinsq++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:32:39
                                              
/Users/thebarty/.meteor/packages/static-html/.1.2.2.10tinsq++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:190
      throw error;
      ^
ExitWithCode {
  code: 1,
  stack: 'undefined\n' +
    ' => awaited here:\n' +
    '    at Function.Promise.await (/Users/thebarty/.meteor/packages/static-html/.1.2.2.10tinsq++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:35:12)\n' +
    '    at /tools/cordova/run-targets.js:111:5\n' +
    '    at /Users/thebarty/.meteor/packages/static-html/.1.2.2.10tinsq++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:32:39\n' +
    ' => awaited here:\n' +
    '    at Function.Promise.await (/Users/thebarty/.meteor/packages/static-html/.1.2.2.10tinsq++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:35:12)\n' +
    '    at /tools/cordova/runner.js:98:17\n' +
    '    at Object.capture (/tools/utils/buildmessage.js:283:5)\n' +
    '    at CordovaRunner.startRunTargets (/tools/cordova/runner.js:97:37)\n' +
    '    at AppRunner._runOnce (/tools/runners/run-app.js:760:21)\n' +
    '    at AppRunner._fiber (/tools/runners/run-app.js:927:28)\n' +
    '    at /tools/runners/run-app.js:401:12'
}

Help

Any ideas what else to try???

I have the same problem.
If you launch the emulator using AndroidStudio before running executing

meteor run android

the build works and the application gets launched.

1 Like

Nice! I’ll have to give your trick a try!

For me hooking up a real android device and running meteor run android-device did the trick.

I lost too much time on this one…