Let me start by saying that I am new to Gradle, Android Studio, and Git. We just migrated from Eclipse and SVN to these technologies and are having a bit of trouble getting our Android project running. We are developing on a Mac. I have inherited this project from another team and am unsure of why they chose to do certain things. [Unfortunately, I had to censor the name of the project and the user throughout the screenshots.]
We are using c ogg libraries to record audio files in our Android application.
The error we are receiving is:
We've found this blog post and this stackoverflow question which links to this other SO question, but we have been unable to get any of them working.
We are unsure if the project is set up correctly, as there seem to be a lot of Android.mk files floating around.
From the question links above, it seems we need to force Gradle to not overwrite our Android.mk files with it's own, but the suggestions only seemed to put us further down the rabbit hole.
Would anyone kindly point us in the right direction?
jni/Android.mk
LOCAL_PATH := $(call my-dir)
LOCAL_C_INCLUDE := $(LOCAL_PATH)/include
include $(addprefix $(LOCAL_PATH)/, $(addsuffix /Android.mk, \
libogg \
libvorbis \
libvorbis-jni \
))
jni/libogg/Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libogg
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../include -ffast-math -fsigned-char
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -march=armv6 -marm -mfloat-abi=softfp -mfpu=vfp
endif
LOCAL_SRC_FILES := \
bitwise.c \
framing.c
include $(BUILD_SHARED_LIBRARY)
jni/libvorbis-jni/Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := vorbis-jni
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../include -fsigned-char
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -march=armv6 -marm -mfloat-abi=softfp -mfpu=vfp
endif
LOCAL_SHARED_LIBRARIES := libogg libvorbis
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
LOCAL_SRC_FILES := \
com_*****_android_audio_VorbisEncoder.c
include $(BUILD_SHARED_LIBRARY)
jni/libvorbis/Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libvorbis
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../include -ffast-math -fsigned-char
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -march=armv6 -marm -mfloat-abi=softfp -mfpu=vfp
endif
LOCAL_SHARED_LIBRARIES := libogg
LOCAL_SRC_FILES := \
mdct.c \
smallft.c \
block.c \
envelope.c \
window.c \
lsp.c \
lpc.c \
analysis.c \
synthesis.c \
psy.c \
info.c \
floor1.c \
floor0.c \
res0.c \
mapping0.c \
registry.c \
codebook.c \
sharedbook.c \
lookup.c \
bitrate.c \
vorbisfile.c \
vorbisenc.c
include $(BUILD_SHARED_LIBRARY)
build.gradle of the project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
build.gradle of the project module
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.*****.android.hud"
minSdkVersion 14
targetSdkVersion 18
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}