.so正确编译进apk里打包
来源:互联网 发布:用java 编写一个计算器 编辑:程序博客网 时间:2024/06/05 03:32
我先说说我犯错的 地方。
1.jni下的Android.mk里的c文件 没有写全 LOCAL_SRC_FILES :=2.app下的Android.mk没有这句:include $(LOCAL_PATH)/jni/Android.mk
好。这样之后 make android的时候就不会报错了。会在out/target/product/generic/obj/lib下生成相应的.so。这里有就说明你的.so编译成功。
JNI下的Android.mk:
#
# Copyright 2009 Cedric Priscal
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#TARGET_PLATFORM := android-3
LOCAL_MODULE_TAGS := eng
#LOCAL_MODULE_TAGS := optional
# This is the target being built.
LOCAL_MODULE := libserialport //
# All of the source files that we will compile.
LOCAL_SRC_FILES := \
SerialPort.c \
RemoTIAPI.c //这里只要你的jni下有多少c文件都要写完。不然。。。
# All of the shared libraries we link against.
LOCAL_SHARED_LIBRARIES := \
libutils
# No static libraries.
LOCAL_STATIC_LIBRARIES :=
# Also need the JNI headers.
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE)
# No special compiler flags.
LOCAL_CFLAGS +=
#LOCAL_LDLIBS := -ldl -llog
LOCAL_PRELINK_MODULE := false
include $(BUILD_SHARED_LIBRARY) //编译so库
项目下的Android.mk:
TOP_LOCAL_PATH:= $(call my-dir)
# Build activity
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
# LOCAL_MODULE_TAGS := user, eng
LOCAL_MODULE_TAGS := optional //这里也要注意!这里 要与你make android源码后出现的列表里的TARGET_BUILD_VARIANT=xxx 一样
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME :=FieldTest
# LOCAL_CERTIFICATE := platform
LOCAL_JNI_SHARED_LIBRARIES := libserialport //安装库
## Use the folloing include to make our RemoteControl apk.
include $(BUILD_PACKAGE) //编译成apk
include $(LOCAL_PATH)/jni/Android.mk //调用库的编译
# ============================================================
# Also build all of the sub-targets under this one: the shared library.
#include $(call all-makefiles-under,$(LOCAL_PATH))
其他的 注释可以在网上搜到。
- .so正确编译进apk里打包
- 在apk里打包进.so文件的方法
- 在apk里打包进.so文件的方法
- android源码中编译打包so文件进apk
- android 源码编译 怎么把so ,a,jar打包到apk里
- 【转载】.so文件打包进apk方法
- so打包到apk
- cocos打包apk,编译.so文件出错解决
- ANT编译APK脚本,能多渠道打包,打包SO,很强大,增强版!
- Eclipse与Android源码编译过程(针对如何将第三方so文件打包进apk中)
- Eclipse与Android源码编译过程(针对如何将第三方so文件打包进apk中)
- 解决编译打包apk时自动删除第三方so文件或不完整问题
- Android 源码编译将不同平台的静态so打包到apk。
- ndk 编译.so 到apk
- android 通过Android.mk将三方的so库编译到apk里
- 通过mmm等命令生成apk时so如何打包进apk的方法
- andriod 源码开发,打包so到apk
- 动态库so打包到android apk
- 寻找子序列
- ASoC – ALSA for System on Chip Devices
- 导入文件时的判断
- ListView动态加载数据
- Memcache的使用和协议分析详解
- .so正确编译进apk里打包
- asp.net中如何向存储过程传递参数
- JDBC学习(1)-数据库建立连接
- 没有include <string>
- 今天才发现,我之前写的文章还真有这么多次的浏览
- A SELECT statement that assigns a value to a variable must ... (向变量赋值的 SELECT 语句不能与数据检索操作结合使用 )
- 滑动式抽屉布局界面SlidingDrawer的简单使用
- [转]linux ——read函数
- Android : No Launcher activity found!