Git Product home page Git Product logo

Comments (4)

cuinjune avatar cuinjune commented on September 27, 2024

I figured out how to fix this error.

Add the following code in ofxLua/libs/lua/luaconf.h file: (e.g. in line 75)

#if defined(LUA_USE_ANDROID)
#include <android/log.h>
#define lua_getlocaledecpoint()    '.'
#define lua_writestring(s,l)        __android_log_write(ANDROID_LOG_DEBUG, "LUA_PRINT", (s))
#define lua_writeline()             __android_log_write(ANDROID_LOG_DEBUG, "LUA_PRINT", "\n")
#define lua_writestringerror(s,p)   __android_log_print(ANDROID_LOG_ERROR, "LUA_PRINT", (s), (p))
#endif

And add the followings in ofxLua/addon_config.mk

android/armeabi:
	ADDON_CFLAGS += -DLUA_USE_ANDROID
	ADDON_SOURCES_EXCLUDE += src/bindings/desktop/% src/bindings/linuxarm/%
	ADDON_INCLUDES_EXCLUDE += src/bindings/desktop/% src/bindings/linuxarm/%

android/armeabi-v7a:	
	ADDON_CFLAGS += -DLUA_USE_ANDROID
	ADDON_SOURCES_EXCLUDE += src/bindings/desktop/% src/bindings/linuxarm/%
	ADDON_INCLUDES_EXCLUDE += src/bindings/desktop/% src/bindings/linuxarm/%

In Android Studio, the exclude flags had no effect on the project (maybe a bug) so I had to manually remove the 2 folders (desktop, linuxarm) from ofxLua/src/bindings directory.

Also, to make Android Studio read the C flags from the addon_config.mk file, I had to add the following code below cppFlags.addAll(addonCppFlags(abi, ofRoot())) in build.gradle file.

  • CFlags.addAll(addonCppFlags(abi, ofRoot()))

After the fix, I could successfully build and run ofxLua project on an Android device.

from ofxlua.

danomatika avatar danomatika commented on September 27, 2024

I've rolled your suggestions into the feature/android branch. Can you check that it builds for Android? The AS project fix steps are included in the readme.

Also, if those project issues are related to the OF ProjecGenerator, I suggest opening an issue with the OF PG repo.

from ofxlua.

danomatika avatar danomatika commented on September 27, 2024

Closing for now.

from ofxlua.

danomatika avatar danomatika commented on September 27, 2024

The feature/android branch is merged now. Please test it when you can and we can go from there.

from ofxlua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.