Trouble finding my custom asset bundle I have a custom asset bundle defined in my plugin. My plugin has a controller. The controller has a action:

/**
 * Handle a request going to our plugin's index action URL,
 * e.g.: actions/entries-by-group/entries-by-group
 *
 * @return mixed
 * @throws \yii\base\InvalidConfigException
 */
public function actionIndex()
{
    $this-&gt;view-&gt;registerAssetBundle(EntriesByGroupAssets::class);
    $result = 'Welcome to the EntriesByGroupController actionIndex() method';

    return $result;
}


As you can see, I am trying to register my asset bundle. I am getting the error:


  ReflectionException
  
  Class recoveryfinder\entriesbygroup\assets\EntriesByGroupAssets does
  not exist


My namespaces are:

namespace recoveryfinder\entriesbygroup\controller;


or in the asset bundle file:

namespace recoveryfinder\entriesbygroup\assets;


My plugin is in a folder called (note the hyphens):


  vendor\recoveryfinder\entries-by-group\src\controllers\EntriesByGroupController.php


It seems that when code gets to ClassLoader::LoadClass I get the error referenced above - class does not exist. It looks to me like ClassLoader is using the namespace as the path spec (without the hyphens) rather than the actual location (with the hyphens).

I must need to set paths in my plugin? If not what is wrong here?
The autoloader won't load files in the folder assets as already stated it is all explained here. Your asset bundles should be in a folder called resources otherwise Yii won't register them in its classmap automatically. 

Your namespaces must represent your folder structure. The namespace ns\prefix\controller must be for a file in vendor\ns\prefix\src\controller so your namespace ns\prefix\assets will search for a file in ...vendor\ns\prefix\src\assets but you have to include the resource on your own via require_once since Yii won't so it because you are in the wrong folder 

The easiest solution would be to create a folder resources and use the namespace ns\prefix\src\resources

Or you can - like stated in the docs - use your plugin root path as well recoveryfinder\entriesbygroup