sonyxperiadev / device-sony-loire

17 stars 40 forks source link

Android 10: build errors #263

Closed jaylinski closed 4 years ago

jaylinski commented 4 years ago

Problem description

I'm getting errors when trying to build Android 10 for my F5121 smartphone.

Help would be very much appreciated. (I must be doing something wrong...)

Explain your steps

  1. Followed official build guide for Android 10 (https://developer.sony.com/develop/open-devices/guides/aosp-build-instructions/build-aosp-android-android-10-0-0)
  2. Build guide step 4: checked out the local_manifests android-10_legacy branch (https://github.com/sonyxperiadev/local_manifests) because I'm building for Loire
  3. Build guide step 4: manually applied patch https://github.com/sonyxperiadev/local_manifests/pull/89
  4. Build guide step 4: manually applied patch https://github.com/sonyxperiadev/device-sony-loire/pull/262
  5. Executed commands in build guide step 5

Build information

VirtualBox Ubuntu 18.04 LTS

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
TARGET_PRODUCT=aosp_f5121
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.3.0-28-generic-x86_64-Ubuntu-18.04.4-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QQ1A.200105.002
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/sony/loire
============================================

Errors

[  0% 749/98491] target  C++: libOmxVenc <= hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/venc
FAILED: out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVenc_intermediates/src/omx_video_encoder.o
/bin/bash -c "PWD=/proc/self/cwd  prebuilts/clang/host/linux-x86/clang-r353983c/bin/clang++     -I hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/venc/inc -I ./system/core/libion/include -I ./system/core/libion/kernel-headers -I hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/common/inc -I hardware/qcom/media/sdm660-libion/mm-core/inc -I hardware/qcom/media/sdm660-libion/libstagefrighthw -I out/target/product/suzu/obj/include/qcom/display -I out/target/product/suzu/obj/include/adreno -I hardware/qcom/media/sdm660-libion/libc2dcolorconvert -I hardware/qcom/media/sdm660-libion/hypv-intercept -I out/target/product/suzu/obj/include/libvqzip -I hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/venc -I out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVenc_intermediates -I out/target/product/suzu/gen/SHARED_LIBRARIES/libOmxVenc_intermediates \$(cat out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVenc_intermediates/import_includes)   -isystem out/target/product/suzu/obj/include -isystem kernel/sony/msm-4.9/common-headers/kernel-headers -c  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -faddrsig -Wimplicit-fallthrough -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-zero-as-null-pointer-constant -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a53 -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin  -Wsign-promo -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden  -std=gnu++17   -fno-rtti -g -O3 -Dlrintf=_ffix_r -D__align=__alignx -D__alignx\\(x\\)=__attribute__\\(\\(__aligned__\\(x\\)\\)\\) -DT_ARM -Dinline=__inline -D_ANDROID_ -UENABLE_DEBUG_LOW -UENABLE_DEBUG_HIGH -DENABLE_DEBUG_ERROR -UINPUT_BUFFER_LOG -UOUTPUT_BUFFER_LOG -USINGLE_ENCODER_INSTANCE -Werror -D_ANDROID_ICS_ -D_MSM8974_ -DMAX_RES_1080P -DMAX_RES_1080P_EBI -D_TARGET_KERNEL_VERSION_49_ -DUSE_ION -DUSE_CAMERA_METABUFFER_UTILS -D__ANDROID_API__=29 -D__ANDROID_VNDK__ -fPIC -D_USING_LIBCXX -DANDROID_STRICT   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare -Wno-tautological-unsigned-zero-compare -Wno-c++98-compat-extra-semi -Wno-return-std-move-in-c++11  -MD -MF out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVenc_intermediates/src/omx_video_encoder.d -o out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVenc_intermediates/src/omx_video_encoder.o hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp"
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp:2766:14: error: use of undeclared identifier 'VEN_MSG_FLUSH_OUTPUT_DONE'
        case VEN_MSG_FLUSH_OUTPUT_DONE:
             ^
1 error generated.
[  0% 750/98491] target  C++: libOmxVenc <= hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/venc
FAILED: out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVenc_intermediates/src/video_encoder_device_v4l2.o
/bin/bash -c "PWD=/proc/self/cwd  prebuilts/clang/host/linux-x86/clang-r353983c/bin/clang++     -I hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/venc/inc -I ./system/core/libion/include -I ./system/core/libion/kernel-headers -I hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/common/inc -I hardware/qcom/media/sdm660-libion/mm-core/inc -I hardware/qcom/media/sdm660-libion/libstagefrighthw -I out/target/product/suzu/obj/include/qcom/display -I out/target/product/suzu/obj/include/adreno -I hardware/qcom/media/sdm660-libion/libc2dcolorconvert -I hardware/qcom/media/sdm660-libion/hypv-intercept -I out/target/product/suzu/obj/include/libvqzip -I hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/venc -I out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVenc_intermediates -I out/target/product/suzu/gen/SHARED_LIBRARIES/libOmxVenc_intermediates \$(cat out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVenc_intermediates/import_includes)   -isystem out/target/product/suzu/obj/include -isystem kernel/sony/msm-4.9/common-headers/kernel-headers -c  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -faddrsig -Wimplicit-fallthrough -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-zero-as-null-pointer-constant -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a53 -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin  -Wsign-promo -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden  -std=gnu++17   -fno-rtti -g -O3 -Dlrintf=_ffix_r -D__align=__alignx -D__alignx\\(x\\)=__attribute__\\(\\(__aligned__\\(x\\)\\)\\) -DT_ARM -Dinline=__inline -D_ANDROID_ -UENABLE_DEBUG_LOW -UENABLE_DEBUG_HIGH -DENABLE_DEBUG_ERROR -UINPUT_BUFFER_LOG -UOUTPUT_BUFFER_LOG -USINGLE_ENCODER_INSTANCE -Werror -D_ANDROID_ICS_ -D_MSM8974_ -DMAX_RES_1080P -DMAX_RES_1080P_EBI -D_TARGET_KERNEL_VERSION_49_ -DUSE_ION -DUSE_CAMERA_METABUFFER_UTILS -D__ANDROID_API__=29 -D__ANDROID_VNDK__ -fPIC -D_USING_LIBCXX -DANDROID_STRICT   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare -Wno-tautological-unsigned-zero-compare -Wno-c++98-compat-extra-semi -Wno-return-std-move-in-c++11  -MD -MF out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVenc_intermediates/src/video_encoder_device_v4l2.d -o out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVenc_intermediates/src/video_encoder_device_v4l2.o hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp"
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp:503:36: error: use of undeclared identifier 'VEN_MSG_FLUSH_OUTPUT_DONE'
                venc_msg.msgcode = VEN_MSG_FLUSH_OUTPUT_DONE;
                                   ^
1 error generated.
[  0% 752/98491] target  C++: libOmxVdec <= hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec
FAILED: out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVdec_intermediates/src/omx_vdec_v4l2.o
/bin/bash -c "PWD=/proc/self/cwd  prebuilts/clang/host/linux-x86/clang-r353983c/bin/clang++     -I hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/inc -I ./system/core/libion/include -I ./system/core/libion/kernel-headers -I hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/common/inc -I hardware/qcom/media/sdm660-libion/mm-core/inc -I out/target/product/suzu/obj/include/qcom/display -I out/target/product/suzu/obj/include/adreno -I hardware/qcom/media/sdm660-libion/libc2dcolorconvert -I hardware/qcom/media/sdm660-libion/hypv-intercept -I out/target/product/suzu/obj/include/mm-video/SwVdec -I out/target/product/suzu/obj/include/mm-video/swvdec -I hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec -I out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVdec_intermediates -I out/target/product/suzu/gen/SHARED_LIBRARIES/libOmxVdec_intermediates \$(cat out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVdec_intermediates/import_includes)   -isystem out/target/product/suzu/obj/include -isystem kernel/sony/msm-4.9/common-headers/kernel-headers -c  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -faddrsig -Wimplicit-fallthrough -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-zero-as-null-pointer-constant -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a53 -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin  -Wsign-promo -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden  -std=gnu++17   -fno-rtti -D__alignx\\(x\\)=__attribute__\\(\\(__aligned__\\(x\\)\\)\\) -D__align=__alignx -Dinline=__inline -g -O3 -DIMAGE_APPS_PROC -D_ANDROID_ -DCDECL -DT_ARM -DNO_ARM_CLZ -UENABLE_DEBUG_LOW -UENABLE_DEBUG_HIGH -DENABLE_DEBUG_ERROR -UINPUT_BUFFER_LOG -UOUTPUT_BUFFER_LOG -Wno-parentheses -D_ANDROID_ICS_ -D_MSM8974_ -DPROCESS_EXTRADATA_IN_OUTPUT_PORT -DMAX_RES_1080P -DMAX_RES_1080P_EBI -D_TARGET_KERNEL_VERSION_49_ -DUSE_ION -D_ANDROID_O_MR1_DIVX_CHANGES -D_QUERY_DISP_RES_ -DADAPTIVE_PLAYBACK_SUPPORTED -DFLEXYUV_SUPPORTED -Werror -D__ANDROID_API__=29 -D__ANDROID_VNDK__ -fPIC -D_USING_LIBCXX -DANDROID_STRICT   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare -Wno-tautological-unsigned-zero-compare -Wno-c++98-compat-extra-semi -Wno-return-std-move-in-c++11  -MD -MF out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVdec_intermediates/src/omx_vdec_v4l2.d -o out/target/product/suzu/obj/SHARED_LIBRARIES/libOmxVdec_intermediates/src/omx_vdec_v4l2.o hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp"
In file included from hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp:50:
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h:748:9: error: ISO C++ forbids forward references to 'enum' types
   enum vdec_output_format output_format;
        ^
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h:748:28: error: field has incomplete type 'enum vdec_output_format'
   enum vdec_output_format output_format;
                           ^
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h:748:9: note: forward declaration of 'vdec_output_format'
   enum vdec_output_format output_format;
        ^
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp:4619:61: error: variable has incomplete type 'enum vdec_output_format'
                                    enum vdec_output_format op_format;
                                                            ^
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h:748:9: note: forward declaration of 'vdec_output_format'
   enum vdec_output_format output_format;
        ^
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp:9286:39: error: use of undeclared identifier 'V4L2_BUF_FLAG_DATA_CORRUPT'
            if (v4l2_buf_ptr->flags & V4L2_BUF_FLAG_DATA_CORRUPT) {
                                      ^
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp:9384:46: error: use of undeclared identifier 'V4L2_BUF_FLAG_DATA_CORRUPT'
                   if (v4l2_buf_ptr->flags & V4L2_BUF_FLAG_DATA_CORRUPT) {
                                             ^
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp:13740:24: error: assigning to 'size_t *' (aka 'unsigned long *') from incompatible type '__u64' (aka 'unsigned long long')
    regions[0].sizes = (__u64)&prefetch_size;
                       ^~~~~~~~~~~~~~~~~~~~~
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp:13743:30: error: assigning to 'struct ion_prefetch_regions *' from incompatible type '__u64' (aka 'unsigned long long')
    prefetch_data->regions = (__u64)regions;
                             ^~~~~~~~~~~~~~
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp:13782:24: error: assigning to 'size_t *' (aka 'unsigned long *') from incompatible type '__u64' (aka 'unsigned long long')
    regions[0].sizes = (__u64)&(m_pf_info.pf_size);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
hardware/qcom/media/sdm660-libion/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp:13786:30: error: assigning to 'struct ion_prefetch_regions *' from incompatible type '__u64' (aka 'unsigned long long')
    prefetch_data->regions = (__u64)regions;
                             ^~~~~~~~~~~~~~
9 errors generated.
15:03:42 ninja failed with: exit status 1

#### failed to build some targets (04:25 (mm:ss)) ####
MarijnS95 commented 4 years ago

I'm assuming you may want to revert https://github.com/sonyxperiadev/device-sony-common/commit/64cfaf3715ec64e040dc978de7fcba4f07807b04 because the sdm660-ion HAL is for "legacy" 4.14 devices. Legacy 4.9 devices should use msm8998 instead, which has an integrated header defining VEN_MSG_FLUSH_OUTPUT_DONE and vdec_output_format.

Try that and report back. Then I'll dust off one of my commits and PR that for you.

jaylinski commented 4 years ago

@MarijnS95 Thanks for the help! The initial build ran for 7 hours (so I guess reverting that commit worked), then failed with an OOM issue:

rm -rf "out/soong/.intermediates/frameworks/base/hiddenapi-lists-docs/android_common/srcjars"
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.base/java.lang.StringUTF16.compress(StringUTF16.java:157)
    at java.base/java.lang.String.<init>(String.java:3015)
    at java.base/java.lang.String.<init>(String.java:249)
    at com.intellij.util.text.StringFactory.createShared(StringFactory.java:60)
    at com.intellij.psi.impl.source.CharTableImpl.createSequence(CharTableImpl.java:90)
    at com.intellij.psi.impl.source.CharTableImpl.intern(CharTableImpl.java:72)
    at com.intellij.lang.impl.PsiBuilderImpl.createLeaf(PsiBuilderImpl.java:1697)
    at com.intellij.lang.impl.PsiBuilderImpl.insertLeaves(PsiBuilderImpl.java:1233)
    at com.intellij.lang.impl.PsiBuilderImpl.bind(PsiBuilderImpl.java:1182)
    at com.intellij.lang.impl.PsiBuilderImpl.buildTree(PsiBuilderImpl.java:913)
    at com.intellij.lang.impl.PsiBuilderImpl.getTreeBuilt(PsiBuilderImpl.java:899)
    at com.intellij.psi.impl.source.JavaFileElementType.parseContents(JavaFileElementType.java:83)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$0(LazyParseableElement.java:192)
    at com.intellij.psi.impl.source.tree.LazyParseableElement$$Lambda$173/2104558722.run(Unknown Source)
    at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:553)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:191)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:245)
    at com.intellij.psi.impl.source.tree.CompositeElement.countChildren(CompositeElement.java:449)
    at com.intellij.psi.impl.source.tree.CompositeElement.getChildrenAsPsiElements(CompositeElement.java:411)
    at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.getClasses(PsiJavaFileBaseImpl.java:66)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$Companion.findClassInPsiFile(KotlinCliJavaFileManagerImpl.kt:250)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$Companion.access$findClassInPsiFile(KotlinCliJavaFileManagerImpl.kt:246)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClassInVirtualFile(KotlinCliJavaFileManagerImpl.kt:216)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.access$findPsiClassInVirtualFile(KotlinCliJavaFileManagerImpl.kt:47)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:69)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:47)
    at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:91)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClass(KotlinCliJavaFileManagerImpl.kt:68)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findClass(KotlinCliJavaFileManagerImpl.kt:124)
    at com.intellij.psi.impl.PsiElementFinderImpl.findClass(PsiElementFinderImpl.java:39)
    at com.intellij.psi.impl.JavaPsiFacadeImpl.doFindClass(JavaPsiFacadeImpl.java:125)
    at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:102)
16:58:23 ninja failed with: exit status 1

#### failed to build some targets (28:07 (mm:ss)) ####

Any chance you can tell me where/how (file, env variable, cli command?) I can increase my JVM heap size when building? (It is currently at 2G according to java -XX:+PrintFlagsFinal. I have 8G RAM and increased the swap to 12G.)

qiangua2460 commented 4 years ago

@ MarijnS95感谢您的帮助!最初的构建运行了7个小时(因此我想还原了提交的工作),然后因OOM问题而失败:

rm -rf "out/soong/.intermediates/frameworks/base/hiddenapi-lists-docs/android_common/srcjars"
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
  at java.base/java.lang.StringUTF16.compress(StringUTF16.java:157)
  at java.base/java.lang.String.<init>(String.java:3015)
  at java.base/java.lang.String.<init>(String.java:249)
  at com.intellij.util.text.StringFactory.createShared(StringFactory.java:60)
  at com.intellij.psi.impl.source.CharTableImpl.createSequence(CharTableImpl.java:90)
  at com.intellij.psi.impl.source.CharTableImpl.intern(CharTableImpl.java:72)
  at com.intellij.lang.impl.PsiBuilderImpl.createLeaf(PsiBuilderImpl.java:1697)
  at com.intellij.lang.impl.PsiBuilderImpl.insertLeaves(PsiBuilderImpl.java:1233)
  at com.intellij.lang.impl.PsiBuilderImpl.bind(PsiBuilderImpl.java:1182)
  at com.intellij.lang.impl.PsiBuilderImpl.buildTree(PsiBuilderImpl.java:913)
  at com.intellij.lang.impl.PsiBuilderImpl.getTreeBuilt(PsiBuilderImpl.java:899)
  at com.intellij.psi.impl.source.JavaFileElementType.parseContents(JavaFileElementType.java:83)
  at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$0(LazyParseableElement.java:192)
  at com.intellij.psi.impl.source.tree.LazyParseableElement$$Lambda$173/2104558722.run(Unknown Source)
  at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:553)
  at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:191)
  at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:245)
  at com.intellij.psi.impl.source.tree.CompositeElement.countChildren(CompositeElement.java:449)
  at com.intellij.psi.impl.source.tree.CompositeElement.getChildrenAsPsiElements(CompositeElement.java:411)
  at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.getClasses(PsiJavaFileBaseImpl.java:66)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$Companion.findClassInPsiFile(KotlinCliJavaFileManagerImpl.kt:250)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$Companion.access$findClassInPsiFile(KotlinCliJavaFileManagerImpl.kt:246)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClassInVirtualFile(KotlinCliJavaFileManagerImpl.kt:216)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.access$findPsiClassInVirtualFile(KotlinCliJavaFileManagerImpl.kt:47)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:69)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:47)
  at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:91)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClass(KotlinCliJavaFileManagerImpl.kt:68)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findClass(KotlinCliJavaFileManagerImpl.kt:124)
  at com.intellij.psi.impl.PsiElementFinderImpl.findClass(PsiElementFinderImpl.java:39)
  at com.intellij.psi.impl.JavaPsiFacadeImpl.doFindClass(JavaPsiFacadeImpl.java:125)
  at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:102)
16:58:23 ninja failed with: exit status 1

#### failed to build some targets (28:07 (mm:ss)) ####

您是否有机会告诉我在哪里/如何(文件,env变量,cli命令?)在构建时可以增加JVM堆大小?(根据java -XX:+PrintFlagsFinal。它当前为2G 。我有8G RAM,并将交换增加到12G。)

Did you solve this problem

jaylinski commented 4 years ago

@qiangua2460 I haven't tried again, because I'm waiting for the pros at https://github.com/sonyxperiadev/bug_tracker/issues/536 to sort out remaining issues.

You can try to build with only one CPU, as proposed here: https://github.com/sonyxperiadev/bug_tracker/issues/551#issuecomment-593100903

qiangua2460 commented 4 years ago

@ qiangua2460我没有再尝试,因为我在等待sonyxperiadev / bug_tracker#536的专家来解决剩余的问题。

您可以尝试仅使用一个CPU进行构建,如此处建议的那样:sonyxperiadev / bug_tracker#551(评论)

I did not use the virtual machine to compile, use ubuntu.

qiangua2460 commented 4 years ago

@ qiangua2460我没有再尝试,因为我在等待sonyxperiadev / bug_tracker#536的专家来解决剩余的问题。 您可以尝试仅使用一个CPU进行构建,如此处建议的那样:sonyxperiadev / bug_tracker#551(评论)

I did not use the virtual machine to compile, use ubuntu.

Do you have other suggestions?

MarijnS95 commented 4 years ago

@qiangua2460 You can run the build "single threaded" by passsing -j1 to make.

qiangua2460 commented 4 years ago

@ qiangua2460您可以通过传递-j1给来运行构建“单线程” make

Oh, let me try, can you solve it, thank you for your answer

qiangua2460 commented 4 years ago

@ qiangua2460您可以通过传递-j1给来运行生成“单线程”)make

qiangua2460 commented 4 years ago

@ qiangua2460您可以通过传递-j1给来运行生成“单线程”)make。 Oh, thank you very much for your answers