SDKBOX IAP Build failed with an exception : externalNativeBuild

Hi. I develop game with cocos2d-x.

I experienced the problem with sdkbox iap import to my game.

Please let me talk if you have any additional gradle script or CMakeLists.txt.

if you talk, i post this script.

I’m sorry I can not speak English well.

Please help… )-; Thanks.

Information -
O/S - macOS Mojave(10.14.4)
Cocos2d-x version - 3.17.1
ndk version - ndk-r19c (Previous version - r16b)

Failed message -
This message

you can try staging server sdkbox import iap --staging

or

I followed your advice.

I got this result…

choepyeonghwaui-MacBook-Pro:proj.android choepyeonghwa$ sdkbox import iap --staging
  _______ ______  _     _ ______   _____  _     _
  |______ |     \ |____/  |_____] |     |  \___/ 
  ______| |_____/ |    \_ |_____] |_____| _/   \_
 Copyright (c) 2016-2018 SDKBOX Inc. v1.0.2.8
  _                          _ 
 |o|  o ,      o_,'   o_,   |o|
 |O| <%'.   _`'_ ===  <\_   |O|
 (0) /  |  (_)`-' |    / |  (0)
 p----------------------------g
A newer version of SDKBOX is available, would you like to update v1.0.2.8 to v1.0.3.0?
Type [Y]es, [n]o or [q]uit 
y
[###################################] 100%
 updated SDKBOX v1.0.2.8 to v1.0.3.0 at /Users/choepyeonghwa/.sdkbox/bin/sdkbox_installer.zip
 Restarting SDKBOX.
  _______ ______  _     _ ______   _____  _     _
  |______ |     \ |____/  |_____] |     |  \___/ 
  ______| |_____/ |    \_ |_____] |_____| _/   \_
 Copyright (c) 2016-2019 SDKBOX Inc. v1.0.3.0
  _                          _ 
 |o|  o ,      o_,'   o_,   |o|
 |O| <%'.   _`'_ ===  <\_   |O|
 (0) /  |  (_)`-' |    / |  (0)
 p----------------------------g
 downloading package sdkbox-iap_v2.4.3.9.tar.gz
[###################################] 100%
 #FATAL: 'ascii' codec can't decode byte 0xe1 in position 25: ordinal not in range(128)
 Installation failed :(

note -
I installed iap into the my project using the Gui installer.

installer version - 1.1.7
iap version - 2.4.3.3

I’ll wait for your comment.

Good luck~! (-:

sdkbox import iap --staging -vv

to show more log.

I try to -

sdkbox import rap --staging -vv

The cause of the problem was the project path.

After correcting the project path, the problem was fixed and the installation was successful.

but, my problem was not resolved.

i tried one more time to cocos compile -p android -m debug -ap ANDROID-16 and the error to externalNativeBuild is still thrown.

What’s the problem???

Thanks for you.

I I compiled successfully with cpp-3.17.1 (PROP_APP_ABI=armeabi-v7a:arm64-v8a)

/Users/admin/test/cpp3171/proj.android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/arm64-v8a:ADDED
/Users/admin/test/cpp3171/proj.android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/arm64-v8a/libMyGame.so:ADDED
Starting process 'command '/Volumes/backup/android/android-ndk-r19c/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip''. Working directory: /Users/admin/test/cpp3171/proj.android/app Command: /Volumes/backup/android/android-ndk-r19c/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip --strip-unneeded -o /Users/admin/test/cpp3171/proj.android/app/build/intermediates/transforms/stripDebugSymbol/debug/0/lib/arm64-v8a/libMyGame.so /Users/admin/test/cpp3171/proj.android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/arm64-v8a/libMyGame.so
Successfully started process 'command '/Volumes/backup/android/android-ndk-r19c/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip''

:cpp3171:transformNativeLibsWithStripDebugSymbolForDebug (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.315 secs.
:cpp3171:processDebugJavaRes (Thread[Task worker for ':' Thread 2,5,main]) started.

> Task :cpp3171:processDebugJavaRes NO-SOURCE
Skipping task ':cpp3171:processDebugJavaRes' as it has no source files and no previous output files.

:cpp3171:processDebugJavaRes (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.0 secs.
:cpp3171:transformResourcesWithMergeJavaResForDebug (Thread[Task worker for ':' Thread 2,5,main]) started.

> Task :cpp3171:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
Skipping task ':cpp3171:transformResourcesWithMergeJavaResForDebug' as it is up-to-date.

:cpp3171:transformResourcesWithMergeJavaResForDebug (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.006 secs.
:cpp3171:validateSigningDebug (Thread[Task worker for ':' Thread 2,5,main]) started.

> Task :cpp3171:validateSigningDebug UP-TO-DATE
Skipping task ':cpp3171:validateSigningDebug' as it is up-to-date.

:cpp3171:validateSigningDebug (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.001 secs.
:cpp3171:packageDebug (Thread[Task worker for ':' Thread 2,5,main]) started.

> Task :cpp3171:packageDebug
Task ':cpp3171:packageDebug' is not up-to-date because:
  Value of input property 'abiFilters' has changed for task ':cpp3171:packageDebug'
All input files are considered out-of-date for incremental task ':cpp3171:packageDebug'.
Unable do incremental execution: full task run

:cpp3171:packageDebug (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.807 secs.
:cpp3171:assembleDebug (Thread[Task worker for ':' Thread 2,5,main]) started.

> Task :cpp3171:assembleDebug
Skipping task ':cpp3171:assembleDebug' as it has no actions.

:cpp3171:assembleDebug (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.0 secs.

BUILD SUCCESSFUL in 7m 24s
55 actionable tasks: 7 executed, 48 up-to-date
VCS Checkout Cache (/Users/admin/test/cpp3171/proj.android/.gradle/vcsWorkingDirs) has not been cleaned up in 0 days
Move apk to /Users/admin/test/cpp3171/bin/debug/android
Build succeed.

would you plz check CMakeLists.txt file

~/test/cpp3171 [master] $ git diff CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e365d8c..964b95c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,6 +129,18 @@ target_include_directories(${APP_NAME}

 # mark app resources
 setup_cocos_app_config(${APP_NAME})
+# PluginIAP
+if(ANDROID)
+    add_definitions(-DSDKBOX_ENABLED)
+    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/PluginIAP/)
+    target_link_libraries(${APP_NAME} ext_PluginIAP)
+endif()
+# sdkbox
+if(ANDROID)
+    add_definitions(-DSDKBOX_ENABLED)
+    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/sdkbox/)
+    target_link_libraries(${APP_NAME} ext_sdkbox)
+endif()
 if(APPLE)
     set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
     if(MACOSX)

I also compiled successfully.

I was typed additional library code at end line in CMakeList.txt. because of that compile failed…

my CMakeLists.txt file - (Compile failed)

...
...
# mark app resources
setup_cocos_app_config(${APP_NAME})    
if(APPLE)
    set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
    if(MACOSX)
        set_target_properties(${APP_NAME} PROPERTIES
                              MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist"
                              )
    elseif(IOS)
        cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
        set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
    endif()
elseif(WINDOWS)
    cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}/..)
endif()

if(LINUX OR WINDOWS)
    cocos_copy_res(COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
endif()
+# PluginIAP
+if(ANDROID)
+    add_definitions(-DSDKBOX_ENABLED)
+    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/PluginIAP/)
+    target_link_libraries(${APP_NAME} ext_PluginIAP)
+endif()
+# sdkbox
+if(ANDROID)
+    add_definitions(-DSDKBOX_ENABLED)
+    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/sdkbox/)
+    target_link_libraries(${APP_NAME} ext_sdkbox)
+endif()

Based on your advice, fixed my problem by typing the code in the line below setup_cocos_app_config.

Thanks for you! Good luck. :slight_smile: