AndroidStudio:3.5.2

AndroidPhone:XiaoMi5 (Android 8.0)

AndroidDemo:3.1.4-44

AndroidDemo 源码路径:SimplicityStudio\v5\developer\sdks\gecko_sdk_suite\v3.2\app\bluetooth\android_application

一、修改为适合于 AndroidStdio 3.5.2 的 gradle 版本

--- android_application\gradle\wrapper\gradle-wrapper.properties
+++ android_application\gradle\wrapper\gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Fri Jul 24 14:59:38 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
--- android_application\build.gradle
+++ android_application\build.gradle
@@ -24,13 +24,13 @@
maven { url 'https://maven.google.com' }
mavenCentral()
jcenter()
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:4.0.2'
+ classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'org.ajoberstar:grgit:1.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1"
}
}

二、解决长时间卡在 Gradle Resolve dependencies of:classpath 的问题

--- android_application\build.gradle
+++ android_application\build.gradle
@@ -18,14 +18,14 @@
} buildscript {
ext.kotlin_version = '1.3.72'
ext.dagger_version = '2.21'
repositories {
- maven { url 'https://maven.google.com' }
- mavenCentral()
+// maven { url 'https://maven.google.com' }
+// mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'org.ajoberstar:grgit:1.5.0'

三、移除需要用 gradle 6.1.1 才能使用包(6.1.1需要 AndroidStudio 4.0 以上版本)

--- android_application\build.gradle
+++ android_application\build.gradle
@@ -8,13 +8,13 @@
def buildNumber = 44 apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
-apply plugin: "de.mannodermaus.android-junit5"
+// apply plugin: "de.mannodermaus.android-junit5" kapt {
generateStubs = true
} buildscript {
@@ -27,13 +27,13 @@
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'org.ajoberstar:grgit:1.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- classpath "de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1"
+// classpath "de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1"
}
} ext {
try {
grgit = Grgit.open(dir: '.')
@@ -146,20 +146,20 @@
kapt "com.google.dagger:dagger-compiler:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
// View
implementation "com.daimajia.swipelayout:library:1.2.0@aar"
//Test
def mockKotlin = 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'
- testImplementation 'org.junit.jupiter:junit-jupiter'
+// testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation mockKotlin
testImplementation 'androidx.arch.core:core-testing:2.1.0'
- testImplementation 'org.mockito:mockito-inline:2.13.0'
+// testImplementation 'org.mockito:mockito-inline:2.13.0'
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.1"
androidTestImplementation mockKotlin
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation "org.mockito:mockito-android:2.24.5"
androidTestImplementation 'org.skyscreamer:jsonassert:1.5.0'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}

四、为了支持 Android 8.0 的手机,修改最小SDK版本为 26

--- android_application\build.gradle
+++ android_application\build.gradle
@@ -54,13 +54,13 @@
} android {
compileSdkVersion 30
defaultConfig {
applicationId "com.siliconlabs.bluetoothmesh"
- minSdkVersion 28
+ minSdkVersion 26
targetSdkVersion 30
versionCode versionMajor * 10000000 + versionMinor * 100000 + versionPatch * 1000 + buildNumber
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
buildConfigField "Integer", "BUILD_NUMBER", "${buildNumber}"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

【随笔记】SiliconLabs Android Demo 编译的更多相关文章

  1. Ubuntu TensorFlow 源码 Android Demo的编译运行

    Ubuntu TensorFlow 源码 Android Demo的编译运行 一. 安装 Android 的SDK和NDK SDK 配置 A:下载 国内下载地址选最新的: SDK: https://d ...

  2. libevent2笔记(linux、windows、android的编译)

    0. 前言 我使用的版本是libevent-2.0.21-stable.高级的应用还是得看官网文档http://www.wangafu.net/~nickm/libevent-2.0/doxygen/ ...

  3. LeadTools Android 入门教学——运行第一个Android Demo

    LeadTools 有很多Windows平台下的Demo,非常全面,但是目前开发手机应用的趋势也越来越明显,LeadTools也给大家提供了10个Android的Demo,这篇文章将会教你如何运行第一 ...

  4. [cocos2dx笔记004] android添加�静态库project

    (基于2.2.2版本号) 这步比較麻烦,不像vs2013那样好设置.參考了非常多文章.还是不能解决这个问题.仅仅有慢慢摸索了.在这里贴出来,希望能让大家能少走点弯路. 还是其于前面的文章提到的myli ...

  5. H3 android 系统编译

    http://bbs.ickey.cn/group-topic-id-57981.html [Orange Pi PC试用体验]11编译android源码笔记 编译android和编译linux有点类 ...

  6. Android 自动编译、打包生成apk文件 2 - 使用原生Ant方式

    from://http://blog.csdn.net/androiddevelop/article/details/11100109 相关文章列表: <Android 自动编译.打包生成apk ...

  7. ubuntu下Android反编译详细教程-apktool,dex2jar,jd-gui的使用

    转载请注明出处:http://blog.csdn.net/fightlei/article/details/52432161 最近在学习Android反编译的一些知识,虽然在网上搜到了很多相关的文章, ...

  8. Android 笔记之 Android 系统架构

    Android笔记之Android系统架构 h2{ color: #4abcde; } a{ color: blue; text-decoration: none; } a:hover{ color: ...

  9. Mac下设置Android源代码编译环境

    在Mac下编译Android最麻烦的就是设置Android的编译环境了,做完这一步基本上剩下的就是近乎傻瓜式的操作了.说起来也简单就三步,设置大小写敏感的文件系统.安装编译工具.设置文件系统同时能打开 ...

  10. Android framework编译出来的jar包classes.jar的位置

    在源码环境下编译 Android framework编译出来的jar包classes.jar的位置  out/target/common/obj/JAVA_LIBRARIES/framework_in ...

随机推荐

  1. 我服了!SpringBoot升级后这服务我一个星期都没跑起来!(上)

    最近由于各方面的原因在准备升级 Spring Cloud 和 Spring Boot,经过一系列前置的调研和分析,决定把Spring Boot 相关版本从 2.1.6 升级到 2.7.5,Spring ...

  2. SpringBoot启动流程源码分析

    前言 SpringBoot项目的启动流程是很多面试官面试中高级Java程序员喜欢问的问题.这个问题的答案涉及到了SpringBoot工程中的源码,也许我们之前看过别的大牛写过的有关SpringBoot ...

  3. 修改api-server支持的NodePort端口映射范围

    创建svc资源报错显示:provided port is not in the valid range. The range of valid ports is 30000-32767 k8s集群默认 ...

  4. 使用Jupyter记事本记录和制作.NET可视化笔记

    前言:对于记录笔记的工具特别多,不过对于程序员来说,记录笔记+程序代码+运行结果演示可以同时存在,无疑会极大增加我们的笔记的可读性和体验感.以前在写python的时候,使用jupyter的体验很好,所 ...

  5. 17、输入一行以空格分隔的英文,判断其共有多少单词,不能包含冠词a

    /*输入一行以空格分隔的英文,判断其共有多少单词,不能包含冠词a */ #include <stdio.h> #include <stdlib.h> int isWord(ch ...

  6. vulnhub靶场之DIGITALWORLD.LOCAL: SNAKEOIL

    准备: 攻击机:虚拟机kali.本机win10. 靶机:DIGITALWORLD.LOCAL: SNAKEOIL,网段地址我这里设置的桥接,所以与本机电脑在同一网段,下载地址:https://down ...

  7. oracle 内置函数(二)字符函数

    主要函数: 大小写转换函数 获取子字符串函数(字符串截取) 获取字符串长度函数 字符串连接函数 去除子字符串函数 字符替换函数 字符串出现次数 字符串按照特定符号拆分多行 一.大小写转换 1.uppe ...

  8. 环境安装-Centos7.4安装及配置

    环境安装-Centos7.4安装及配置 〇.资料汇总 一.虚拟机安装 1.下载地址 https://pan.baidu.com/s/1zcOp06HX4OxPdsCCGkHbXQ 提取码:7777 2 ...

  9. 4.4:Sqoop数据导入实验

    〇.概述 1.拓扑结构 2.目标 使用sqoop工具将数据从mysql数据库导入到HDFS和Hbase 一.配置免密登录hdfs 三.导入到hdfs中 sqoop import --connect j ...

  10. TS编写发布订阅模式

    interface PubSubType { events: { [key: string]: { name: string, once: boolean, cb: Function }[] } on ...