[Android] arnabJ:
[ 25% 8508/33881] build out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy
FAILED: /bin/bash -c "(out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.tmp out/target/product/lux/obj/ETC/sepolicy_intermediates/policy.conf ) && (out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/lux/obj/ETC/sepolicy_intermediates//sepolicy.dontaudit out/target/product/lux/obj/ETC/sepolicy_intermediates/policy.conf.dontaudit ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.tmp permissive > out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ) && (if [ \"userdebug\" = \"user\" -a -s out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ]; then	echo \"==========\" 1>&2;	echo \"ERROR: permissive domains not allowed in user builds\" 1>&2;	echo \"List of invalid domains:\" 1>&2;	cat out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains 1>&2;	exit 1;	fi ) && (mv out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.tmp out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy )"
device/motorola/msm8916-common/sepolicy/akmd09912.te:5:ERROR 'unknown type sensors_data_file' at token ';' on line 20379:

allow akmd09912 sensors_data_file:file { create getattr setattr open read write };
checkpolicy: error(s) encountered while parsing configuration
out/host/linux-x86/bin/checkpolicy: loading policy configuration from out/target/product/lux/obj/ETC/sepolicy_intermediates/policy.conf
[ 25% 8508/33881] target thumb C++: init <= system/core/init/builtins.cpp
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (01:15:02 (hh:mm:ss)) ####

I got this error. And as per your post, I deleted the line - "allow akmd09912 sensors_data_file:file { create getattr setattr open read write };".

Is this what you meant?

Update : I am getting a lot these errors in several different files. Should I delete all the lines where error occurs?

Update 2 : I don't have the specified lines in specified file. What should I do about it? It won't let me pass through there.

[ 0% 15/25335] build out/target/product/lux/obj/ETC/sepolicy_intermediates/policy.conf
m4: device/motorola/msm8916-common/sepolicy/atvc.te: 5: deprecated: unix_socket_connect(atvc, property, init) Please use set_prop(atvc, <property name>) instead.
[ 0% 23/25335] build out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy
FAILED: /bin/bash -c "(out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.tmp out/target/product/lux/obj/ETC/sepolicy_intermediates/policy.conf ) && (out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/lux/obj/ETC/sepolicy_intermediates//sepolicy.dontaudit out/target/product/lux/obj/ETC/sepolicy_intermediates/policy.conf.dontaudit ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.tmp permissive > out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ) && (if [ \"userdebug\" = \"user\" -a -s out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ]; then	echo \"==========\" 1>&2;	echo \"ERROR: permissive domains not allowed in user builds\" 1>&2;	echo \"List of invalid domains:\" 1>&2;	cat out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains 1>&2;	exit 1;	fi ) && (mv out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy.tmp out/target/product/lux/obj/ETC/sepolicy_intermediates/sepolicy )"
device/motorola/msm8916-common/sepolicy/batt_health.te:13:ERROR 'unknown type sysfs_battery_supply' at token ';' on line 20513:
allow batt_health sysfs_batt_health:file { { getattr open read ioctl lock } { open append write lock } };
allow batt_health sysfs_battery_supply:file { getattr open read ioctl lock };
checkpolicy: error(s) encountered while parsing configuration
out/host/linux-x86/bin/checkpolicy: loading policy configuration from out/target/product/lux/obj/ETC/sepolicy_intermediates/policy.conf
[ 0% 23/25335] target thumb C: libmincrypt <= system/core/libmincrypt/p256_ec.c
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (01:42 (mm:ss)) ####