[Solved] Android9.0 separately Compile framework Error: ninja failed with: exit status 1

mmm frameworks/base error

1.1 Error message

frameworks/base/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp:463:32: error: 'onNewImageSnapshot' marked 'override' but does not override any member functions
        virtual sk_sp<SkImage> onNewImageSnapshot() override {
                               ^
frameworks/base/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp:463:32: error: 'RenderNodeDrawable_projectionHwLayer_RenderThreadTest::doTheThing(renderthread::RenderThread &)::ProjectionLayer::onNewImageSnapshot' hides overloaded virtual function [-Werror,-Woverloaded-virtual]
external/skia/src/image/SkSurface_Base.h:49:28: note: hidden overloaded virtual function 'SkSurface_Base::onNewImageSnapshot' declared here: different number of parameters (1 vs 0)
    virtual sk_sp<SkImage> onNewImageSnapshot(const SkIRect* subset = nullptr) = 0;
                           ^
frameworks/base/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp:530:40: error: allocating an object of abstract class type 'ProjectionLayer'
    sk_sp<SkSurface> surfaceLayer1(new ProjectionLayer(&drawCounter));
                                       ^
external/skia/src/image/SkSurface_Base.h:49:28: note: unimplemented pure virtual method 'onNewImageSnapshot' in 'ProjectionLayer'
    virtual sk_sp<SkImage> onNewImageSnapshot(const SkIRect* subset = nullptr) = 0;
                           ^
3 errors generated.
[ 41% 2049/4888] target dex2oat: out/target/product/xxxxxx_xxx/dex_bootjars/system/framework/arm/boot.art
ninja: build stopped: subcommand failed.
11:20:44 ninja failed with: exit status 1

#### failed to build some targets (08:18 (mm:ss)) ####

1.2 Solution

// use /* */  to comment out the frameworks/base/libs/hwui/Android.bp cc_test{***} will Ok, and you can compile now.
/*
 cc_test {
xxx
xxx
xxx
 }
*/

1.3 Test compilation

touch frameworks/base/core/res/res/values-zh-rCN/strings.xml
mmm frameworks/base

[100% 11/11] Install: out/target/product/xxxxxx/system/framework/framework-res.apk

build completed successfully (01:35 (mm:ss))

Compilation succeeded! ! !

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *