Need help for hikey 970 building from aosp


I got the error message like that:
[ 31% 22712/71284] build out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows
FAILED: out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows
/bin/bash -c “(ASAN_OPTIONS=detect_leaks=0 out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/policy.conf ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp neverallow -w -f out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/policy_2.conf || ( echo “” 1>&2; echo “sepolicy-analyze failed. This is most likely due to the use” 1>&2; echo “of an expanded attribute in a neverallow assertion. Please fix” 1>&2; echo “the policy.” 1>&2; exit 1 ) ) && (touch out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp ) && (mv out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows )”
device/linaro/hikey/sepolicy/hostapd.te:4:ERROR ‘unknown type hostapd’ at token ‘;’ on line 50922:
typeattribute hostapd data_between_core_and_vendor_violators;

hostapd no longer directly accesses /data outside /data/vendor.

checkpolicy: error(s) encountered while parsing configuration
20:43:13 ninja failed with: exit status 1

Is there anybody has a solution ?
It happend when I was compile from AOSP.
It confused me for 3days . Googled but nothing help.

I saw someone who had removed this so in device/linaro/hike I did:

diff --git a/ b/
index 56fedc0e..5bf801a4 100644
--- a/
+++ b/
@@ -27,7 +27,7 @@ DEVICE_PACKAGE_OVERLAYS := device/linaro/hikey/overlay
 PRODUCT_PACKAGES += ssh sftp scp sshd ssh-keygen sshd_config start-ssh
 # Add wifi-related packages
-PRODUCT_PACKAGES += libwpa_client wpa_supplicant hostapd wificond wifilogd
+PRODUCT_PACKAGES += libwpa_client wpa_supplicant wificond wifilogd
 PRODUCT_PROPERTY_OVERRIDES += wifi.interface=wlan0 \
diff --git a/sepolicy/hostapd.te b/sepolicy/hostapd.te
deleted file mode 100644
index 86b985ae..00000000
--- a/sepolicy/hostapd.te
+++ /dev/null
@@ -1,11 +0,0 @@
-# TODO(b/36657258): Remove data_between_core_and_vendor_violators once
-# hostapd no longer directly accesses /data outside /data/vendor.
-typeattribute hostapd data_between_core_and_vendor_violators;
-# hostapd can read and write WiFi related data and configuration.
-allow hostapd wifi_data_file:file rw_file_perms;
-r_dir_file(hostapd, wifi_data_file)
-# hostapd wants to create the directory holding its control socket.
-allow hostapd hostapd_socket:dir create_dir_perms;
-# hostapd needs to create, bind to, read, and write its control socket.
-allow hostapd hostapd_socket:sock_file create_file_perms;
diff --git a/ b/
index 6797c3ad..dbddf729 100755
--- a/
+++ b/
@@ -22,3 +22,4 @@
 add_lunch_combo hikey-userdebug
 add_lunch_combo hikey960-userdebug
+add_lunch_combo hikey970-userdebug

This let me at least compile