Android studio doesn't appear to be reading .mk files -
i using android studio 1.3 experimental ndk plugin enabled. trying compile box2d placing box2d folder jni folder. have android.mk , application.mk in there well. whenever try compile android studio spits out errors header files cannot found. seems no matter .mk files nothing changes. it's not being read. android studio read .mk files?
local_path:=$(call my-dir) $(info $(local_path)) source_directories:=\ collision \ collision/shapes \ common \ dynamics \ dynamics/contacts \ dynamics/joints \ particle \ rope include $(local_path)/b2_android_common.mk # conditionally include libstlport (so include path added cflags) if # it's not being built using ndk build process. define add-stlport-includes $(eval \ ifeq ($(ndk_project_path),) include external/stlport/libstlport.mk endif) endef # configure common local variables build box2d adding $(1) end of # build target's name. define box2d-module $(eval \ local_module:=libliquidfun$(1) local_module_tags:=optional local_copy_headers_to:=liquidfun$(1)) endef # execute shell command relative module's directory. define execute-local $(patsubst ./%,%,$(shell cd $(local_path) ; eval "$(1)")) endef # configure local variables build box2d adding $(1) end of # build target's name. define box2d-build $(eval \ $$(call box2d-module,$(1)) local_src_files:=\ $(subst $(local_path)/,,\ $(foreach source_dir,$(source_directories),\ $(foreach extension,$(b2_extensions),\ $(wildcard $(local_path)/box2d/$(source_dir)/*.$(extension))))) local_copy_headers:=\ box2d/box2d.h \ $(subst $(local_path)/,,\ $(foreach source_dir,$(source_directories),\ $(wildcard $(local_path)/box2d/$(source_dir)/*.h))) local_cflags:=$(if $(app_debug),-ddebug=1,-ddebug=0) $(b2_cflags) local_export_c_includes:=$(local_path) local_arm_mode:=arm $$(call add-stlport-includes)) endef # --- libliquidfun --- # build shared library. include $(clear_vars) $(call box2d-build,) include $(build_shared_library) # --- libliquidfun_static --- # build static library. include $(clear_vars) $(call box2d-build,_static) include $(build_static_library)
no, android studio doesn't read *.mk files.
it generates makefiles automatically source files under jni/, following configuration can inside build.gradle.
you can try making box2d compile way. you'll have write configuration one:
android.ndk { //... stl = stlport_static cppflags += "-i${file("src/main/jni/box2d/collision")}".tostring() // includes //... }
else, if want makefiles considered, can call ndk-build
yourself. set inside build.gradle not try compile code, , .so files src/main/libs/:
android.sources{ main.jni { source { srcdirs = ['src/main/none'] // [] set instead disable symbol resolution inside editor } } main.jnilibs { source { srcdirs = ['src/main/libs'] } } }
Comments
Post a Comment