gradle

android gradle NDK简介

杀马特。学长 韩版系。学妹 提交于 2020-02-10 05:27:17
本章介绍在Android开发中,关于NDK,gradle相关的知识点。 1.NDK简介 (1)NDK是一系列工具的集合 NDK提供了一系列的工具,帮助开发者快速开发C(或C++)的动态库,并能自动将so和java应用一起打包成apk。这些工具对开发者的帮助是巨大的。NDK集成了交叉编译器,并提供了相应的mk文件隔离CPU、平台、ABI等差异,开发人员只需要简单修改mk文件(指出“哪些文件需要编译”、“编译特性要求”等),就可以创建出so。NDK可以自动地将so和Java应用一起打包,极大地减轻了开发人员的打包工作。 (2)NDK提供了一份稳定、功能有限的API头文件声明 Google明确声明该API是稳定的,在后续所有版本中都稳定支持当前发布的API。从该版本的NDK中看出,这些API支持的功能非常有限,包含有:C标准库(libc)、标准数学库(libm)、压缩库(libz)、Log库(liblog)。 2.NDK产生的背景   Android平台从诞生起,就已经支持C、C++开发。众所周知,Android的SDK基于Java实现,这意味着基于 Android SDK进行开发的第三方应用都必须使用Java语言。但这并不等同于“第三方应用只能使用Java”。在Android SDK首次发布 时,Google就宣称其虚拟机Dalvik支持JNI编程方式

gradle 初体验

拟墨画扇 提交于 2020-02-06 18:09:31
1,gradle 认识。 gradle 和 maven ,ant类似,是一个构建工具,底层依赖groovy脚本语言,groovy 也是一个完全可以兼容运行在JVM上的一个脚本语言,类似的scala 也是运行在JVM,而maven 是java 编写的,构建配置是XML, gradle 是脚本语言来构建配置,好处不言而喻,同时ant 迁移gradle 也很方便。是android studio 的默认内置构建工具。 维基百科定义 1,gradle 下载 https://gradle.org/releases/ 解压,配置环境变量 2,idea 新建gradle 工程 idea 自己内置了gradle 的版本,可以进去配置为自己指定的版本 1>新建一个gradle 项目 打开groovy 编辑器,一个命令行终端,开始学习groovy 的基本用法,为编写gradle 构建脚本打下基础。 概念入门, https://www.w3cschool.cn/groovy/ groovy 是一个运行在java 虚拟机上成熟的,面向对象,的弱类型,脚本语言,构建在Java语言之上,添加了python,的流行语言的很多特性,闭包,元编程,动态类型转换等等。 groovy 和Java 类似,但作为脚本语言,语法简化很多 例如定义一个类, 1,不需要public, 2,不需要类型说明 3,不需要setter

gradle配置项packagingOptions

可紊 提交于 2020-02-05 11:41:08
版权声明:本文为延成原创文章,转载请标明出处 packagingOptions常见的设置项有exclude、pickFirst、doNotStrip、merge。 1. exclude,过滤掉某些文件或者目录不添加到APK中,作用于APK,不能过滤aar和jar中的内容。 比如: packagingOptions { exclude 'META-INF/**' exclude 'lib/arm64-v8a/libmediaplayer.so' } 2. pickFirst,匹配到多个相同文件,只提取第一个,作用于APK,不能过滤aar和jar中的文件。 比如: packagingOptions { pickFirst "lib/armeabi-v7a/libaaa.so" pickFirst "lib/armeabi-v7a/libbbb.so" } 3. doNotStrip,可以设置某些动态库不被优化压缩。 比如: packagingOptions { doNotStrip "*/armeabi/*.so" doNotStrip "*/armeabi-v7a/*.so" } 4. merge,将匹配的文件都添加到APK中,和pickFirst有些相反,会合并所有文件。 比如: packagingOptions { merge '**/LICENSE.txt' merge '**

Use Custom gradle plugin module in another module

末鹿安然 提交于 2020-02-05 07:37:06
问题 I am developing a custom plugin that I want to be able to deploy to a repository at a later stage so I've created a stand alone module for it. Before I do any formal TDD on it, I wanna do certain exploratory tests manually so, I've created a demo module that uses the given plugin in. The only way I've found so far to do this was to deploy the plugin into a local repository and then import it on the other module. But this is very tedious and it's quite easy to forget to deploy it. I was

Gradle Daemon Android Studio: “Unable to start the daemon process”

大兔子大兔子 提交于 2020-02-05 05:52:06
问题 I am having a problem. I have always developed applications in Android Studio and never had a problems, but now I had the following error: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.4/userguide/gradle_daemon.html I already changed in gradle.properties the following line org.gradle.jvmargs=-Xmx1536m to

Using Gradle to publish jars to MavenLocal

徘徊边缘 提交于 2020-02-05 04:34:05
问题 I'm using Gradle to manage the build of a product using multiple eclipse projects. Several of those projects use jar files that are not available from a central repository (like MavenCentral). I'd like to have an eclipse project that I just place those jars into, and a build.gradle that will place those jar files into mavenLocal using the groupId, artifactId and version that I specify. This way I can just add mavenLocal() to other projects and specify the dependency. I have the following

Spring源码编译下载

被刻印的时光 ゝ 提交于 2020-02-04 14:58:57
下载源码 2B哥在家远程办公,心血来潮,整理点spring源码玩玩。 可以在github上下载 ,也可以下载我课堂的源码(有注释) git clone https://github.com/spring-projects/spring-framework.git 配置gradle 编译环境 Spring源码是通过gradle编译的,所以要先配置gradle编译环境 gradle下载安装 下载地址 ,我本地环境用的 v4.10.2 解压安装,安装路径不要出现空格(建议),如图 2、配置环境变量 选中系统变量path,然后编辑,打开编辑环境,新建, 输入配置路径C:\apache\gradle-4.10.2\bin 验证环境安装是否正常,如下图,表示正常 3. 导入idea,配置idea环境 导入spring-framwork到idea 打开idea, 选择File—Open,选择解压的spring-framwork,导入到idea 配置idea中gradle环境 File—Settings ,搜索gradle, 配置gradle 指定gradle home: C:/apache/gradle-4.10.2 安装路径 Service directory path指定了gradle仓库: D:/maven/gradle/.gradle 自定义 vm参数可不配: -XX

Apply hibernate-gradle-plugin using plugins dsl syntax?

徘徊边缘 提交于 2020-02-04 13:27:46
问题 I want to use org.hibernate:hibernate-gradle-plugin in my project with plugins dsl style. This is my build.gradle.kts plugin section: plugins { kotlin("jvm") version "1.3.31" id("io.spring.dependency-management") version "1.0.6.RELEASE" id("org.springframework.boot") version "2.1.5.RELEASE" id("org.jetbrains.kotlin.plugin.spring") version "1.3.31" id("org.jetbrains.kotlin.plugin.jpa") version "1.3.31" } Does anybody knows how to do this? All of the documentation and posts are using the legacy

android导入项目build错误

一个人想着一个人 提交于 2020-02-04 10:42:20
android studio apply script build.gradle 卡死 buildscript { repositories { maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} google() } } allprojects { repositories { maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} google() } } No cached version of com.android.tools.build:gradle:3.2.1 available for offline mode settings->Build...->Gradle里取消Offline work选项 来源: https://www.cnblogs.com/qiaoxueli/p/12258460.html

how to fix Android Annotations 4.6.0 compile with android Studio 3.5 and 3.5.0 gradle

浪子不回头ぞ 提交于 2020-02-04 07:11:32
问题 I updated Android studio to 3.5 but there is a problem when I use android annotations Gradle may disable incremental compilation as the following annotation processors are not incremental: jetified-androidannotations-4.6.0.jar (org.androidannotations:androidannotations:4.6.0). Consider setting the experimental feature flag android.enableSeparateAnnotationProcessing=true in the gradle.properties file to run annotation processing in a separate task and make compilation incremental I've put