app installed to /system/priv-app won't run Prerequisites:


a rooted Rockchip-based China tablet device running Android 6, patched to disable SystemUI
own-developed app which declares LAUNCHER category and is intended to take full conrol of the device


What am I trying to achieve: 

install the app as a system app to avoid handling SDK 23+ permissions

What have I done so far: 


installed the app regularly via Android Studio
moved the app to /system/priv-app:


(root)

ls /data/app/my.package.name-1
 base.apk
 lib
 oat
mount -o rw,remount /system
mv /data/app/my.package.name-1 /system/priv-app/AppName
ls -la /system/priv-app/AppName
 -rw-r--r-- system   system    2464934 2017-12-08 11:32 base.apk
 drwxr-xr-x system   system            2017-12-08 11:32 lib
 drwxrwx--x system   install           2017-12-08 11:32 oat
reboot


What is the problem?

It seems the system is not aware the app exists: it does not run on boot (which it perfectly does when installed as a regular app) and I am unable to launch it manually:

root@rk312x:/ # am start -n my.package.name/.ui.MainActivity
Starting: Intent { cmp=my.package.name/.ui.MainActivity }
Error type 3
Error: Activity class {my.package.name/my.package.name.ui.MainActivity} does not exist.


What am I missing?
Moving an application from one space to another on Marshmallow and more superior will almost always result in that. The best way use the cp command, after that delete the source. An application at data has it's own set permissions which persist to the system and though even if you change them, since there's no new instance of file creation, the system just doesn't take care to trigger preparation of the app. The best way is

cp /data/app/[package.name]-1/app-name.apk /system/app/[app-folder-name]/app-name.apk


Repeat this for the libs in the app folder to the app folder. The folder should look like:

APPNAME containing .apk and LIB folder
LIB folder containing type of lib like ARM folder
ARM folder with all libraries eg libexample.so

set permission of all folders to chmod 0755
and all files to permission chmod 0644

They will work. To make life easier, stop using the shell commands. Look for a file manager to simplify your work but always remember of you're using TWRP or Terminal on a boot device always copy and delete source. Moving for many ROMs will actually lead to that

NOTE: The oat folder in that folder at /data/app/package.name/ is of no use. Dalvik will create it's new classes.dex at /data/dalvik-cache on install as system application