'Android Native Unit test Coverage for cpp via gcov and lcov

I am trying to run lcov and gcov on android platform for unit test coverage. I am able to generate .gcno file and .gcda file successfully via the flags.

Android.mk

LOCAL_CFLAGS += -g -O0 --coverage 
                -fprofile-arcs -ftest-coverage

LDFLAGS += -fprofile-arcs -ftest-coverage
LOCAL_LDLIBS := --coverage

And I have made sure gcov and gcc are same version in my case 4.9 but I get this weird

error:file.gcno:version '402*', prefer '409*'

BR M S Kha



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source