前言
FLIR官网上有四个demo,可以供我们参考。我这里买的是Android版本的,所以使用的是Android Studio进行构建,版本是3.5.0,比较新了。
但是因为需要引入外部的一些依赖以及第三方文件,demo一开始一直无法顺利编译。因此我们需要进行一些操作。
流程
1.添加阿里镜像
Android是通过gradle构建的,一开始你的Project的build.gradle
文件中是这么写的。
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() google() } dependencies { classpath 'com.android.tools.build:gradle:3.3.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() google() } } task clean(type: Delete) { delete rootProject.buildDir }
由于网络的原因,这些官方库加载十分缓慢,导致构建无法完成,因此我们需要添加阿里的镜像,使其能够更加高效地完成加载。
在上面两处repositoryies
中添加一行:
复制代码
1
2
3
4maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} jcenter() google()
2.外部aar文件添加
在app的build.gradle
中有这样一段话:
复制代码
1
2
3
4
5
6
7
8
9repositories { // default path where thermalsdk AAR is stored flatDir dirs: '../../../modules/thermalsdk/build/outputs/aar' // default path where androidsdk AAR is stored flatDir dirs: '../../../modules/androidsdk/build/outputs/aar' // superproject path where all required AARs are stored (for local debug builds only) flatDir dirs: '../../../MastodonAndroid/prebuilt-aar' }
这样我们就知道了之前为什么编译不通过了,因为缺少了相对应的文件。所以我们只要创建对应的文件夹,然后将下载好的aar文件放入其中就可以了。当然要注意的是..
,表示上一层,这个层级有点多,注意不要改错。添加文件之后重新import项目,应该就可以成功编译了。
参考链接
- https://juejin.im/post/5acd6daaf265da238a30ca73#heading-8
最后
以上就是愤怒热狗最近收集整理的关于解决FLIR One Android Demo项目加载问题前言流程参考链接的全部内容,更多相关解决FLIR内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复