Unable to create an Android bundle with a native extension (SOLVED)

I’m using Defold 1 editor, version 1.2.107, on Linux.

I’ve created a dummy extension, in an empty (default) project.

When I want to create an Android bundle, the build fails with a very long error. Here are some parts of the error that I think may be interesting:

(..)
                 from upload/myextension/src/myextension.cpp:2:
/var/extender/sdk/597b94fc8d88b8f24264d54a59851951d04eae5c/defoldsdk//include/dmsdk/dlib/log.h:109:2: warning: #warning "DLIB_LOG_DOMAIN is not defined" [-Wcpp]
 #warning "DLIB_LOG_DOMAIN is not defined"
  ^
upload/myextension/src/myextension.cpp: In function 'void LuaInit(lua_State*)':
upload/myextension/src/myextension.cpp:56:22: error: 'MODULE_NAME' was not declared in this scope
     luaL_register(L, MODULE_NAME, Module_methods);
                      ^
upload/myextension/src/myextension.cpp: In function 'dmExtension::Result InitializeMyExtension(dmExtension::Params*)':
upload/myextension/src/myextension.cpp:71:41: error: 'MODULE_NAME' was not declared in this scope
     printf("Registered %s Extension\n", MODULE_NAME);
(..)

Here is the full error log:
defold-error.zip (1.6 KB)

And here is the complete project, if it can help:
project.zip (136.4 KB)

Thanks in advance for your help.

Have you defined MODULE_NAME in your extension? Like this: https://github.com/britzl/defold-timer/blob/master/timer/src/timer.cpp#L4

That’s it, I messed up while copy-pasting the source code from the manual, so I skipped the #defines… I’m sorry :sweat:

Thank you very much for your help.

1 Like