Cannot sign apk

I cannot sign the last apk I’ve compiled. I needed to speciy its output path at File->Project Settings->Project->Project compiler output and set the paths File->Project Settings->Facets->Manifest file and File->Project Settings->Facets->Resources directory . But, I don’t know if they are correctly pointed.

I believe I should also set the paths for Assets directory and Native libs directory but I have no clue where to point them. IN fact, when I try to sign the APK I get:

Error:Module ‘06-QRScanner’ production: java.lang.NoClassDefFoundError: com/android/resources/ResourceFolderType

Any ideas what could be the problem or how to solve it? I’ve search in many pages (I’ve been looking for 3-4 days now) but none of them seem to work.

Thanks in advance. Best regards,