[Android] DiamondJohn:
Build ResurectionRemix from LineageOS Device & Vendor. failed...

I am attempting to build a ResurectionRemix Nougat ROM. It is a non suported device (xt897), however, the device IS a LineageOS supported device. I think I read on here somewhere that the Lineage Vendor and Device trees could be used to build RR ROMs, so i gave it a go. I CAN build LineageOS for the device, so I copied across the Device and Vendor trees from LineageOS, into the source for RR. It appeared to be working :highfive: up to about 87% of the build, but then failed :crying:

I get the following error. The full log is attached below. The final error appears to be:

[2017-07-18 17:31:15] [ 87% 30030/34216] Install: /home/ubuntu/android/RR/out/target/product/xt897/system/priv-app/MmsService/MmsService.apk
[2017-07-18 17:31:15] [ 87% 30031/34216] target R.java/Manifest.java: MotoDoze (/home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/src/R.stamp)
[COLOR="Red"][2017-07-18 17:31:15] FAILED: /bin/bash -c "(rm -rf /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/src/R.stamp && mkdir -p /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/src/ ) && (mkdir -p /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/src ) && (mkdir -p /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/ ) && (/home/ubuntu/android/RR/out/host/linux-x86/bin/aapt package --auto-add-overlay --auto-add-overlay -z --extra-packages android.support.v14.preference:android.support.v7.appcompat:android.support.v7.preference:android.support.v7.recyclerview:com.android.settingslib --pseudo-localize -m -J /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/src -M device/motorola/qcom-common/doze/AndroidManifest.xml -P /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/public_resources.xml -S device/motorola/qcom-common/doze/res -S device/motorola/qcom-common/doze/../../../../packages/resources/devicesettings/res -S frameworks/support/v14/preference/res -S frameworks/support/v7/appcompat/res -S frameworks/support/v7/preference/res -S frameworks/support/v7/recyclerview/res -S frameworks/base/packages/SettingsLib/res -I /home/ubuntu/android/RR/out/target/common/obj/APPS/framework-res_intermediates/package-export.apk -I /home/ubuntu/android/RR/out/target/common/obj/APPS/org.cyanogenmod.platform-res_intermediates/package-export.apk -G /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/proguard_options --min-sdk-version 25 --target-sdk-version 25 --version-code 25 --version-name 7.1.2 --skip-symbols-without-default-localization ) && (for GENERATED_MANIFEST_FILE in \`find /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/src -name Manifest.java 2> /dev/null\`; do dir=\`awk '/package/{gsub(/\\./,"/",\$2);gsub(/;/,"",\$2);print \$2;exit}' \$GENERATED_MANIFEST_FILE\`; mkdir -p /home/ubuntu/android/RR/out/target/common/R/\$dir; /home/ubuntu/android/RR/out/host/linux-x86/bin/acp -fp \$GENERATED_MANIFEST_FILE /home/ubuntu/android/RR/out/target/common/R/\$dir; done ) && (for GENERATED_R_FILE in \`find /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/src -name R.java 2> /dev/null\`; do dir=\`awk '/package/{gsub(/\\./,"/",\$2);gsub(/;/,"",\$2);print \$2;exit}' \$GENERATED_R_FILE\`; mkdir -p /home/ubuntu/android/RR/out/target/common/R/\$dir; /home/ubuntu/android/RR/out/host/linux-x86/bin/acp -fp \$GENERATED_R_FILE /home/ubuntu/android/RR/out/target/common/R/\$dir || exit 31; /home/ubuntu/android/RR/out/host/linux-x86/bin/acp -fp \$GENERATED_R_FILE /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/src/R.stamp || exit 32; done ) && (touch /home/ubuntu/android/RR/out/target/common/obj/APPS/MotoDoze_intermediates/src/R.stamp )"
[2017-07-18 17:31:15] ERROR: resource directory 'device/motorola/qcom-common/doze/../../../../packages/resources/devicesettings/res' does not exist[/COLOR]
[2017-07-18 17:31:16] [ 87% 30031/34216] Building with Jack: /home/ubuntu/android/RR/out/target/common/obj/APPS/OneTimeInitializer_intermediates/with-local/classes.dex
[2017-07-18 17:31:17] [ 87% 30031/34216] target R.java/Manifest.java: ManagedProvisioning (/home/ubuntu/android/RR/out/target/common/obj/APPS/ManagedProvisioning_intermediates/src/R.stamp)
[2017-07-18 17:31:23] [ 87% 30031/34216] target R.java/Manifest.java: OmniJaws (/home/ubuntu/android/RR/out/target/common/obj/APPS/OmniJaws_intermediates/src/R.stamp)
[2017-07-18 17:31:23] Warning: AndroidManifest.xml already defines versionCode (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:23] Warning: AndroidManifest.xml already defines versionName (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:23] Warning: AndroidManifest.xml already defines minSdkVersion (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:23] Warning: AndroidManifest.xml already defines targetSdkVersion (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:23] [ 87% 30031/34216] target R.java/Manifest.java: MtpDocumentsProvider (/home/ubuntu/android/RR/out/target/common/obj/APPS/MtpDocumentsProvider_intermediates/src/R.stamp)
[2017-07-18 17:31:24] [ 87% 30031/34216] target R.java/Manifest.java: Contacts (/home/ubuntu/android/RR/out/target/common/obj/APPS/Contacts_intermediates/src/R.stamp)
[2017-07-18 17:31:24] Warning: AndroidManifest.xml already defines versionCode (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:24] Warning: AndroidManifest.xml already defines versionName (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:24] Warning: AndroidManifest.xml already defines minSdkVersion (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:24] Warning: AndroidManifest.xml already defines targetSdkVersion (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:24] nothing matches overlay file view_pager_tab_background.xml, for flavor v21
[2017-07-18 17:31:28] [ 87% 30031/34216] target R.java/Manifest.java: Gallery2 (/home/ubuntu/android/RR/out/target/common/obj/APPS/Gallery2_intermediates/src/R.stamp)
[2017-07-18 17:31:28] Warning: AndroidManifest.xml already defines versionCode (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:28] Warning: AndroidManifest.xml already defines versionName (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:28] Warning: AndroidManifest.xml already defines minSdkVersion (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:28] Warning: AndroidManifest.xml already defines targetSdkVersion (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:28] [ 87% 30031/34216] target R.java/Manifest.java: Dialer (/home/ubuntu/android/RR/out/target/common/obj/APPS/Dialer_intermediates/src/R.stamp)
[2017-07-18 17:31:28] Warning: AndroidManifest.xml already defines versionCode (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:28] Warning: AndroidManifest.xml already defines versionName (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:28] Warning: AndroidManifest.xml already defines minSdkVersion (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:28] Warning: AndroidManifest.xml already defines targetSdkVersion (in [url]http://schemas.android.com/apk/res/android);[/url] using existing value in manifest.
[2017-07-18 17:31:28] ninja: build stopped: subcommand failed.
[2017-07-18 17:31:28] build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
[2017-07-18 17:31:28] make: *** [ninja_wrapper] Error 1
[2017-07-18 17:31:28] make: Leaving directory '/home/ubuntu/android/RR'
[2017-07-18 17:31:29]
[COLOR="red"][2017-07-18 17:31:29] [0;31m#### make failed to build some targets (01:02:04 (hh:mm:ss)) ####[/COLOR]

My build script is:

cd ~/android/RR
source build/envsetup.sh;
lunch lineage_xt897-userdebug
make clobber
croot;
brunch lineage_xt897-userdebug 2>&1 | ts '[%Y-%m-%d %H:%M:%S]' | tee -a $HOME/brunch_out.log;

I can build LineageOS for the device successfully. I would be pretty stoked if I could get RR to build for the device:victory: And it may also help others converting their LOS ROM builds to RR. I basically copied the following device and vendor directories over to the RR paths.

~/android/lineage/kernel/motorola
copied to ==> ~/android/RR/kernel/motorola

~/android/lineage/vendor/motorola
copied to ==> ~/android/RR/vendor/motorola

~/android/lineage/device/motorola
copied to ==> ~/android/RR/device/motorola

Anyone have ideas of what is going wrong in the above? or how to get to a better error description? I have also included a log from a successful LOS build in case it might help.