You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/03/31 16:34:15 UTC

[GitHub] [cordova-android] jringbox opened a new issue #936: Cannot read property 'toString' of null

jringbox opened a new issue #936: Cannot read property 'toString' of null
URL: https://github.com/apache/cordova-android/issues/936
 
 
   # Bug Report
   
   ## Problem
   
   Current project I have is retrieved from a code repository.  This has node_modules and all build related artifacts excluded.  After doing a, `npm install` followed by `cordova -d build` android, the following is shown.
   
   ```
   Checking Java JDK and Android SDK versions
   ANDROID_SDK_ROOT=C:\Users\jring\AppData\Local\Android\Sdk (recommended setting)
   ANDROID_HOME=C:\Users\jring\AppData\Local\Android\Sdk (DEPRECATED)
   Cannot read property 'toString' of null
   TypeError: Cannot read property 'toString' of null
       at Object.module.exports.get_gradle_wrapper (C:\clinicallink\temp\git.latest\clinicallink-mobile\src-cordova\platforms\android\cordova\lib\check_reqs.js:96:27)
       at Object.module.exports.check_gradle (C:\clinicallink\temp\git.latest\clinicallink-mobile\src-cordova\platforms\android\cordova\lib\check_reqs.js:135:37)
       at ProjectBuilder.prepEnv (C:\clinicallink\temp\git.latest\clinicallink-mobile\src-cordova\platforms\android\cordova\lib\builders\ProjectBuilder.js:222:27)
       at Api.module.exports.run (C:\clinicallink\temp\git.latest\clinicallink-mobile\src-cordova\platforms\android\cordova\lib\build.js:174:20)
       at C:\clinicallink\temp\git.latest\clinicallink-mobile\src-cordova\platforms\android\cordova\Api.js:302:43
       at _fulfilled (C:\clinicallink\temp\git.latest\clinicallink-mobile\src-cordova\node_modules\q\q.js:854:54)
       at C:\clinicallink\temp\git.latest\clinicallink-mobile\src-cordova\node_modules\q\q.js:883:30
       at Promise.promise.promiseDispatch (C:\clinicallink\temp\git.latest\clinicallink-mobile\src-cordova\node_modules\q\q.js:816:13)
       at C:\clinicallink\temp\git.latest\clinicallink-mobile\src-cordova\node_modules\q\q.js:624:44
       at runSingle (C:\clinicallink\temp\git.latest\clinicallink-mobile\src-cordova\node_modules\q\q.js:137:13)
   ```
   
   The personal workspace for the project with node_modules and all build related directories under platforms/android which I keep separately builds fine.  I can't figure out what so different about my workspace artifacts and the clean checkout where node_modules and all build related artifacts are excluded.
   
   Assistance is appreciated in resolving this issue.
   
   ### What is expected to happen?
   
   successful build
   
   ### What does actually happen?
   
   Cannot read property 'toString' of null
   
   ## Information
   
   unable to provide complete steps for creating project to reproduce issue.
   
   ### Command or Code
   This is built from CLI using "cordova build android".
   
   ### Environment, Platform, Device
   Windows 10 Enterprise
   
   ### Version information
   "cordova-android": "^8.1.0"
   This project is under "src-cordova" using vue-cli-plugin-cordova 2.4.0.
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [X] I searched for existing GitHub issues
   - [X] I updated all Cordova tooling to most recent version
   - [X] I included all the necessary information above
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-android] jringbox edited a comment on issue #936: Cannot read property 'toString' of null

Posted by GitBox <gi...@apache.org>.
jringbox edited a comment on issue #936: Cannot read property 'toString' of null
URL: https://github.com/apache/cordova-android/issues/936#issuecomment-606744706
 
 
   I should also mention that line 92 of `check_reqs.js` produces null for result.stdout.  `__dirname` appears to be correct to where `getASPath.bat` is located.  Running the command locally does display the correct location to Android Studio.  I'm confused why this logic will not produce the string correctly for `result.stdout`.
   
   Also, there is something I should mention.  With a fresh checkout, if I make a copy of "platforms" (which only has android), do a `npm install`, then delete platforms and restore the backup copy I just made, do a `cordova build android`, the build is successful.  I even checked `check_reqs.js` and found that `result.stdout` has the right value.  What's going on here?!?  Why would `npm install` cause `result.stdout` in the js script to cause a wrong lookup of android studio path?  Or there something else going on that I'm missing?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-android] jringbox edited a comment on issue #936: Cannot read property 'toString' of null

Posted by GitBox <gi...@apache.org>.
jringbox edited a comment on issue #936: Cannot read property 'toString' of null
URL: https://github.com/apache/cordova-android/issues/936#issuecomment-606744706
 
 
   I should also mention that line 92 of `check_reqs.js` produces null for result.stdout.  `__dirname` appears to be correct to where `getASPath.bat` is located.  Running the command locally does display the correct location to Android Studio.  I'm confused why this logic will not produce the string correctly for `result.stdout`.
   
   If I hardcode on line 111 for `androidStudioPath` with what `getASPath.bat` provided when I execute it manually, then `cordova build android` builds successfully.
   
   Also, there is something I should mention.  With a fresh checkout, if I make a copy of "platforms" (which only has android), do a `npm install`, then delete platforms and restore the backup copy I just made, do a `cordova build android`, the build is successful.  I even checked `check_reqs.js` and found that `result.stdout` has the right value.  What's going on here?!?  Why would `npm install` cause `result.stdout` in the js script to cause a wrong lookup of android studio path?  Or there something else going on that I'm missing?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-android] jringbox commented on issue #936: Cannot read property 'toString' of null

Posted by GitBox <gi...@apache.org>.
jringbox commented on issue #936: Cannot read property 'toString' of null
URL: https://github.com/apache/cordova-android/issues/936#issuecomment-606744706
 
 
   I should also mention that line 92 of `check_reqs.js` produces null for result.stdout.  `__dirname` appears to be correct to where `getASPath.bat` is located.  Running the command locally does display the correct location to Android Studio.  I'm confused why this logic will not produce the string correctly for `result.stdout`.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-android] jringbox edited a comment on issue #936: Cannot read property 'toString' of null

Posted by GitBox <gi...@apache.org>.
jringbox edited a comment on issue #936: Cannot read property 'toString' of null
URL: https://github.com/apache/cordova-android/issues/936#issuecomment-606744706
 
 
   I should also mention that line 92 of `check_reqs.js` produces null for result.stdout.  `__dirname` appears to be correct to where `getASPath.bat` is located.  Running the command locally does display the correct location to Android Studio.  I'm confused why this logic will not produce the string correctly for `result.stdout`.
   
   If I hardcode on line 111 for `androidStudioPath` with what `getASPath.bat` provides when I execute it manually, then `cordova build android` builds successfully.
   
   Also, there is something I should mention.  With a fresh checkout, if I make a copy of "platforms" (which only has android), do a `npm install`, then delete platforms and restore the backup copy I just made, do a `cordova build android`, the build is successful.  I even checked `check_reqs.js` and found that `result.stdout` has the right value.  What's going on here?!?  Why would `npm install` cause `result.stdout` in the js script to cause a wrong lookup of android studio path?  Or there something else going on that I'm missing?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-android] jringbox edited a comment on issue #936: Cannot read property 'toString' of null

Posted by GitBox <gi...@apache.org>.
jringbox edited a comment on issue #936: Cannot read property 'toString' of null
URL: https://github.com/apache/cordova-android/issues/936#issuecomment-606744706
 
 
   I should also mention that line 92 of `check_reqs.js` produces null for result.stdout.  `__dirname` appears to be correct to where `getASPath.bat` is located.  Running the command locally does display the correct location to Android Studio.  I'm confused why this logic will not produce the string correctly for `result.stdout`.
   
   Also, there is something I should mention.  If I make a copy of "platforms" (which only has android), do a `npm install`, then delete platforms and restore the backup copy I just made, the build works fine with `cordova build android`.  I even checked `check_reqs.js` and not `result.stdout` has the right value.  What's going on here?!?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org