Android Export RigidBody Error

hello , When I use rigidbody and want to get Android output, it gives an error

Hi please post the errors.

I recorded a video of the error, please give me your email address and I will send it to you
Thanks

I can get the apk output without using rigidbody, but when I use rigidbody, it gives an error

E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:2431:57: error: too few arguments provided to function-like macro invocation
  DEFINE_PRIM(_VOID, btCollisionWorld_debugDrawWorld0 _IDL);
                                                          ^
E:/3D/Armory/ArmorySDK2307/Kha/Backends/Kinc-HL/hl/src\hl.h:783:9: note: macro 'DEFINE_PRIM' defined here
  #define DEFINE_PRIM(t,name,args)                                                DEFINE_PRIM_WITH_NAME(t,name,args,name)
          ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:2431:1: error: C++ requires a type specifier for all declarations
  DEFINE_PRIM(_VOID, btCollisionWorld_debugDrawWorld0 _IDL);
  ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4020:42: error: too many arguments provided to function-like macro invocation
  DEFINE_PRIM(_I16, btIntArray_set2, _IDL, _I16, _I16);
                                           ^
E:/3D/Armory/ArmorySDK2307/Kha/Backends/Kinc-HL/hl/src\hl.h:783:9: note: macro 'DEFINE_PRIM' defined here
  #define DEFINE_PRIM(t,name,args)                                                DEFINE_PRIM_WITH_NAME(t,name,args,name)
          ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4020:1: error: C++ requires a type specifier for all declarations
  DEFINE_PRIM(_I16, btIntArray_set2, _IDL, _I16, _I16);
  ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4025:35: error: too few arguments provided to function-like macro invocation
  DEFINE_PRIM(_I16, btIntArray_size0);
                                    ^
E:/3D/Armory/ArmorySDK2307/Kha/Backends/Kinc-HL/hl/src\hl.h:783:9: note: macro 'DEFINE_PRIM' defined here
  #define DEFINE_PRIM(t,name,args)                                                DEFINE_PRIM_WITH_NAME(t,name,args,name)
          ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4025:1: error: C++ requires a type specifier for all declarations
  DEFINE_PRIM(_I16, btIntArray_size0);
  ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4030:39: error: too few arguments provided to function-like macro invocation
  DEFINE_PRIM(_BYTES, btIntArray_get_raw);
                                        ^
E:/3D/Armory/ArmorySDK2307/Kha/Backends/Kinc-HL/hl/src\hl.h:783:9: note: macro 'DEFINE_PRIM' defined here
  #define DEFINE_PRIM(t,name,args)                                                DEFINE_PRIM_WITH_NAME(t,name,args,name)
          ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4030:1: error: C++ requires a type specifier for all declarations
  DEFINE_PRIM(_BYTES, btIntArray_get_raw);
  ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4053:44: error: too many arguments provided to function-like macro invocation
  DEFINE_PRIM(_I16, btFloatArray_set2, _IDL, _I16, _F32);
                                             ^
E:/3D/Armory/ArmorySDK2307/Kha/Backends/Kinc-HL/hl/src\hl.h:783:9: note: macro 'DEFINE_PRIM' defined here
  #define DEFINE_PRIM(t,name,args)                                                DEFINE_PRIM_WITH_NAME(t,name,args,name)
          ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4053:1: error: C++ requires a type specifier for all declarations
  DEFINE_PRIM(_I16, btFloatArray_set2, _IDL, _I16, _F32);
  ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4058:37: error: too few arguments provided to function-like macro invocation
  DEFINE_PRIM(_I16, btFloatArray_size0);
                                      ^
E:/3D/Armory/ArmorySDK2307/Kha/Backends/Kinc-HL/hl/src\hl.h:783:9: note: macro 'DEFINE_PRIM' defined here
  #define DEFINE_PRIM(t,name,args)                                                DEFINE_PRIM_WITH_NAME(t,name,args,name)
          ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4058:1: error: C++ requires a type specifier for all declarations
  DEFINE_PRIM(_I16, btFloatArray_size0);
  ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4063:41: error: too few arguments provided to function-like macro invocation
  DEFINE_PRIM(_BYTES, btFloatArray_get_raw);
                                          ^
E:/3D/Armory/ArmorySDK2307/Kha/Backends/Kinc-HL/hl/src\hl.h:783:9: note: macro 'DEFINE_PRIM' defined here
  #define DEFINE_PRIM(t,name,args)                                                DEFINE_PRIM_WITH_NAME(t,name,args,name)
          ^
E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/bullet.cpp:4063:1: error: C++ requires a type specifier for all declarations
  DEFINE_PRIM(_BYTES, btFloatArray_get_raw);
  ^
1 warning and 14 errors generated.
[296/297] Building CXX object CMakeFiles/kinc.dir/E_/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/DebugDrawer.cpp.o
In file included from E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/DebugDrawer.cpp:1:
In file included from E:/3D/Armory/ArmorySDK2307/lib/haxebullet/hl/DebugDrawer.h:8:
E:/3D/Armory/ArmorySDK2307/Kha/Backends/Kinc-HL/hl/src\hl.h:56:10: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined]
  #       define _GNU_SOURCE
                 ^
  <built-in>:401:9: note: previous definition is here
  #define _GNU_SOURCE 1
          ^
  1 warning generated.
  ninja: build stopped: subcommand failed.

  C++ build system [build] failed while executing:
      @echo off
      "E:\\AndroidSDK\\cmake\\3.18.1\\bin\\ninja.exe" ^
        -C ^
        "D:\\Projects\\Armory\\2\\build_untitled\\android-hl-build\\untitled_1_0_5\\app\\.cxx\\Debug\\4q3q311g\\arm64-v8a" ^
        kinc
    from D:\Projects\Armory\2\build_untitled\android-hl-build\untitled_1_0_5\app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 34s
24 actionable tasks: 24 executed
ERROR: Building the APK failed, check console

Are you using the SDK downloaded from itch.io? Is the SDK modified in any way?

No, I am using the sdk downloaded by Android Studio

Sorry, I meant the Armory SDK.

Please, thank you
Where can I download armory sdk?

I am using ArmorySDK2307 version

Okay, but where did you download it from? And did you modify the files after they were downloaded.

I downloaded it from the armory website and did not make any changes in the files

Okay. Do you have Visual Studio installed? If yes, could you please try to build for Windows(C) target.

I am asking because I cannot reproduce the issue so far…

Yes, I have visual studio and there is no problem when I output for Windows, and only when I output for Android, there is a problem

I get apk output directly from blender using the publish button

Interesting. Just to be sure, you actually build an exe application right? Not just export?

I just want to get apk output for android and I don’t need windows output
I have done this with other game engines such as Unreal Engine, Unity and Godot

This is likely the same as Android studio export bug - #4 by timodriaan, please try what I proposed there and let me know if it works for you. I was still waiting for feedback in the other thread, but I will open a pull request later today for these changes so that it will be fixed in the next SDK release before we have to wait another month :slight_smile:

The reason the error cannot be reproduced with Visual Studio is that the malformed bullet.cpp is only causing warnings there, but not actual errors.

For some more background on this issue see the Discord discussion following this message.

Edit: opened a pull request for the changes: https://github.com/armory3d/haxebullet/pull/44. @golin1388 please try the solution I linked above (or wait for the next SDK release if my PR is merged) and let me know whether compilation is fixed for you, maybe there are even more Android compilation issues that need to be fixed (the error messages mention a few more things that may or may not be a consequence of the described issue).

1 Like