Wednesday, September 12, 2018

How to resolve "Cannot resolved symbol 'android'" error when apply GoogleMaps library?

Prerequisite

- Android Studio 3.1.4
  • Import GoogleMaps library to Android project, encounter error message "Cannot resolved symbol 'android'"

Steps to resolve
  • Click on "Tools" → "SDK Manager" to launch "Default Settings" window
  • Click on "SDK Tools" tab and select "Google play services" checkbox. 

  • Click on "File" → "Project Structure" to launch "Project Structure" window
  • Click on "Dependencies" tab, add "com.google.android.gms:play-services-maps:15.0.1" library, rebuild the project and the issue will be resolved.

Saturday, September 8, 2018

How to resolve "jit-grunt: Plugin for the "karma" task not found." when execute grunt test?

  • Run the grunt command "grunt test", error message as shown below is displayed
jit-grunt: Plugin for the "karma" task not found.
If you have installed the plugin already, please setting the static mapping.
See https://github.com/shootaroo/jit-grunt#static-mappings

Warning: Task "karma" failed. Use --force to continue.

Aborted due to warnings.
  • Execute the command below to install karma, the problem will be resolved.
npm install grunt-karma karma karma-phantomjs-launcher 
karma-jasmine jasmine-core phantomjs-prebuilt --save-dev

Friday, September 7, 2018

How to resolve "Path must be a string. Received null Use" error message when execute grunt script?

  • Run the grunt script, error message as shown below is displayed
Running "jshint:all" (jshint) task
Warning: Path must be a string. Received null Use --force to continue.
Aborted due to warnings.
  • To resolve this, add the script as shown below to jshint section
options:{
 reporterOutput:''
},
  • Please refer to the sample source, it will work perfectly
grunt.initConfig({
 jshint:{
  options:{
    reporterOutput:''
   },
   all:['script.js']
  }
 });