Android studio 项目使用
jni配置:参考网址:http://www.cnblogs.com/flyme/p/4431762.html
ndk {
moduleName “native”
ldLibs “log”, “z”, “m”
stl “gnustl_static”
cFlags “-std=c++11 -fexceptions”
}
新导入的项目:
1.一般新导入的项目需要配置gradle 修改自己项目中使用的gradle 文件位置在app.gradle(app指的是自己项目的名字)
2. compileSdkVersion 23
buildToolsVersion ‘23.0.3’ 这里的support 同步
3.修改output里面apk名字参考:http://www.jianshu.com/p/93051c9e97fb
/*def releaseTime() {
return new Date().format(“yyyy-MM-dd”, TimeZone.getTimeZone(“UTC”))
}*/
productFlavors {
demo{}
}
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
//这里修改apk文件名
apply plugin: 'announce'
/*-${defaultConfig.versionCode}-${defaultConfig.versionName}-${releaseTime()*/
def fileName = "${variant.productFlavors[0].name}.apk"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
本文详细介绍了如何在Android Studio项目中进行JNI配置,包括模块名称设置、链接库选择、STL版本指定及C++编译选项等。同时,还提供了新导入项目的Gradle配置指南,涉及SDK版本、构建工具版本的更新以及APK输出文件名的定制方法。
3137

被折叠的 条评论
为什么被折叠?



