Could not find method cppFlags() arguments() for arguments

前端 未结 1 1036
慢半拍i
慢半拍i 2021-01-03 23:41

I am trying to use

std::function

But the compiler throws an error

Error:(50, 10) error: no type named \'function\' in nam         


        
1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-04 00:18

    There are two entirely different blocks in build.gradle that are named externalNativeBuild (thanks, Google).

    One is under android top-level block, and it specifies the path to native build script, cmake or ndkBuild (but not both).

    The other can be used to specify, from gradle, some parameters for the native build. This block is usually a child of the defaultConfig block, but can also appear for flavors (see an example).

    These externalNativeBuild blocks can also have cmake or ndkBuild children, but only the child that matches the path setting (see above) is relevant, the other is silently ignored.

    The bottom line, split your block in two, and put each one in correct place in build.gradle hierarchy.

    0 讨论(0)
提交回复
热议问题