← All tasks
cppcocos2d/cocos2d-x #18846Not a task: not reproduced

libcpufeatures.a is outputted to the wrong path on build

envgap__cocos2d__cocos2d-x-18846

01 / FAILURE SIGNATURE

As reported upstream

cocos2d\cocos\math/MathUtil.cpp:114: error: undefined reference to ‘android_getCpuFamily’
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
2b805039727d044658f8ead58aa529c951e2bd81
Manifest
cocos/audio/CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

cocos2d/cocos2d-x #18846 · read the original issue
- cocos2d-x version: 3.17

- devices test on: N/A

- developing environments

   - NDK version: r16b

   - Xcode version: N/A

   - VS version: N/A

   - browser type and version: N/A



gradle.properties:

PROP_BUILD_TYPE = cmake



gradle.build cmake section:

`arguments “-DGEN_COCOS_PREBUILT=ON”, “-DUSE_COCOS_PREBUILT=OFF”`



The output folder I set contains these prebuilt libraries after I do a build (android/x86 and android/armeabi-v7a):

libcocos2d.a

libcocos2d_android.a

libflatbuffers.a

libpvmp3dec.a

librecast.a

libtinyxml2.a

libtremolo.a

libunzip.a

libxxhash.a



Once they’re built, I change the line in build.gradle to:

`arguments “-DGEN_COCOS_PREBUILT=OFF”, “-DUSE_COCOS_PREBUILT=ON”`



but I get this error on build:

```

cocos2d\cocos\math/MathUtil.cpp:114: error: undefined reference to ‘android_getCpuFamily’

cocos2d\cocos\math/MathUtil.cpp:114: error: undefined reference to ‘android_getCpuFeatures’

```



because of this:



– can’t find cocos prebuilt library: cpufeatures



The source of the problem is this:



libcpufeatures.a is being built into:

`.externalNativeBuild/cmake/debug/${ANDROID_ABI}/`



while the rest of the libraries are being built into:

`.externalNativeBuild/cmake/debug/${ANDROID_ABI}/lib/`



So, when the copy happens, it copies everything from ${ANDROID_ABI}/lib, which does not contain the libcpufeatures.a

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]