cpp_client_telemetry icon indicating copy to clipboard operation
cpp_client_telemetry copied to clipboard

Android - Wrong import location when building release

Open darax opened this issue 2 years ago • 8 comments

https://github.com/microsoft/cpp_client_telemetry/blob/e8eb28fab9f382e4ce34c61525dcfffe1a1f9e9f/lib/android_build/app/src/main/cpp/CMakeLists.txt#L86

gradlew assembleRelease results in ninja: error: 'D:/git/2ds/lib/android_build/maesdk/build/intermediates/cmake/debug/obj/armeabi-v7a/libmaesdk.so', needed by 'D:/git/2ds/lib/android_build/app/build/intermediates/cmake/release/obj/armeabi-v7a/libnative-lib.so

darax avatar Feb 03 '23 01:02 darax

I'm guessing the right thing to do is have IMPORTED_LOCATION reference ${CMAKE_BUILD_TYPE} instead of debug.

darax avatar Feb 03 '23 01:02 darax

I had similar error because maesdk wasn't built, gradlew assembleRelease builds test app

Make sure that you have use java 11 (Android Studio 4.2.2)

try to run

export PATH="/usr/local/opt/openjdk@11/bin:$PATH"
./gradlew maesdk:assembleRelease

anod avatar Feb 03 '23 13:02 anod

I'm pretty sure the issue is trying to consume a debug binary from a release build. If you simply 'assemble' that will assemble debug, and then the assembleRelease will produce a build. Since it is including the built debug binary, the build really isn't release, but an unintentional hybrid.

darax avatar Feb 07 '23 01:02 darax

Since this is a test app, I think it just doesn't meant to support release build.

anod avatar Feb 07 '23 04:02 anod

@darax - Is this still a valid issue ?

lalitb avatar Mar 07 '23 21:03 lalitb

I believe it is, yes.

darax avatar Mar 08 '23 19:03 darax