我对这个问题感到非常沮丧.我一直得到它,我无法弄清楚为什么.这是我在src/jni中的Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := tutorial01
LOCAL_SRC_FILES := tutorial01.c
LOCAL_LDLIBS := -llog -lz
LOCAL_SHARED_LIBRARIES := libavformat_static libavcodec_static libavutil_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,ffmpeg-2.4.2/android/armv7-a)
Run Code Online (Sandbox Code Playgroud)
这是我的/jni/ffmpeg-2.4.2/android/armv7-a中的Android.mk
LOCAL_PATH:= $(call my-dir)
#static version of libavcodec
include $(CLEAR_VARS)
LOCAL_MODULE:= libavcodec
LOCAL_SRC_FILES:= lib/libavcodec.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_STATIC_LIBRARY)
#static version of libavformat
include $(CLEAR_VARS)
LOCAL_MODULE:= libavformat
LOCAL_SRC_FILES:= lib/libavformat.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_STATIC_LIBRARY)
#static version of libswscale
include $(CLEAR_VARS)
LOCAL_MODULE:= libswscale
LOCAL_SRC_FILES:= lib/libswscale.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_STATIC_LIBRARY)
#static version of libavutil
include …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Linux机器上的ant构建android项目.该项目在我的Mac机器上构建时没有问题,但在linux机器上.似乎无法弄明白为什么!
我打字了
ant release
Run Code Online (Sandbox Code Playgroud)
然后我收到以下消息:
BUILD FAILED
/android/android-sdk-linux/tools/ant/build.xml:885: The following error occurred while executing this line:
/android/android-sdk-linux/tools/ant/build.xml:887: The following error occurred while executing this line:
/android/android-sdk-linux/tools/ant/build.xml:899: The following error occurred while executing this line:
/android/android-sdk-linux/tools/ant/build.xml:281: null returned: 137
Run Code Online (Sandbox Code Playgroud)
以及build.xml文件中的行
275 <dex executable="${dx}"
276 output="${intermediate.dex.file}"
277 dexedlibs="${out.dexed.absolute.dir}"
278 nolocals="@{nolocals}"
279 forceJumbo="${dex.force.jumbo}"
280 disableDexMerger="${dex.disable.merger}"
281 verbose="${verbose}">
<path path="${out.dex.input.absolute.dir}"/>
<path refid="out.dex.jar.input.ref" />
<external-libs />
</dex>
.
.
.
.
.
884 <target name="-dex" depends="-compile, -post-compile, -obfuscate">
885 <do-only-if-manifest-hasCode elseText="hasCode = false. Skipping...">
886 …Run Code Online (Sandbox Code Playgroud) 假设我们有以下扩展函数:
class Helper {
companion object {
fun Int.plus(value: String) = Integer.valueOf(value).plus(this)
}
Run Code Online (Sandbox Code Playgroud)
}
如何plus从Helper另一个类中的类访问扩展函数。有没有办法让我们可以做这样的事情,例如:
class OtherClass {
fun someMethod() {
val eight = 7.Helper.Companion.plus("1")
}
Run Code Online (Sandbox Code Playgroud)
}