How to add css and js file in custom module I created a custom module in drupal 8. And I am trying to add js and css file in 
my_module.libraries.yml file using this 

lrv_key:
  version: 1.x
  js:
    js/lrv.js: {}   
    dependencies:
      - core/jquery
      - core/drupalSettings
  css:
    theme:
      css/lrv.css: {}


But it doesnt work.
To understand how to correctly define a library, see how Drupal core defines its library, for example the ones defined in core.libraries.yml.

jquery:
  remote: https://github.com/jquery/jquery
  version: "3.2.1"
  license:
    name: MIT
    url: https://github.com/jquery/jquery/blob/3.2.1/LICENSE.txt
    gpl-compatible: true
  js:
    assets/vendor/jquery/jquery.min.js: { minified: true, weight: -20 }

jquery.cookie:
  remote: https://github.com/carhartl/jquery-cookie
  version: "v1.4.1"
  license:
    name: MIT
    url: https://github.com/carhartl/jquery-cookie/blob/v1.4.1/MIT-LICENSE.txt
    gpl-compatible: true
  js:
    assets/vendor/jquery.cookie/jquery.cookie.min.js: { minified: true }
  dependencies:
    - core/jquery

jquery.farbtastic:
  remote: https://github.com/mattfarina/farbtastic
  # @todo Ping @robloach or @mattfarina to retroactively create this release.
  version: "1.2"
  license:
    name: GNU-GPL-2.0-or-later
    url: https://github.com/mattfarina/farbtastic/blob/master/LICENSE.txt
    gpl-compatible: true
  js:
    assets/vendor/farbtastic/farbtastic.js: { minified: true }
  css:
    component:
      assets/vendor/farbtastic/farbtastic.css: {}
  dependencies:
    - core/jquery


The dependencies key is not a sub-key of js, nor css, but it is at the same level of the js and css keys.
Keep in mind that the dependencies key defines the dependencies of the library from other libraries.

I would rather use the following library declaration.

lrv:
  version: 1.x
  js:
    js/lrv.js: {}   
  css:
    theme:
      css/lrv.css: {}
  dependencies:
    - core/jquery
    - core/drupalSettings


A .libraries.yml file just defines the libraries, which aren't automatically loaded, since the definition doesn't say to Drupal when they should be loaded.
To load your library, for example in hook_page_attachments(), you use code similar to the following.

function mymodule_page_attachments(array &amp;$attachments) {
  $attachments['#attached']['library'][] = 'mymodule/lrv';
}


The name of the library is mymodule/lrv because it is defined as key lrv (the one I used in the code I shown) in the file mymodule.libraries.yml (the one you seem to use).

See Defining a library and Attaching a library to page(s).