gradle

How do I use the standalone Jetifier to migrate to AndroidX?

泪湿孤枕 提交于 2020-05-10 03:31:30
问题 The Jetifier tool is used as part of the AndroidX migration tool bundled with Android Studio. There is an issue with the tool, however, that is outlined here: https://issuetracker.google.com/issues/113224601. The error message looks like this when running the Jetifier on certain libraries (one particular library keeps popping up for multiple users: org.eclipse.jdt.core ): Failed to transform '/path/to/library/org.eclipse.jdt.core-3.10.0.jar' using Jetifier. Reason: The type does not support '

The import org.junit.jupiter cannot be resolved

给你一囗甜甜゛ 提交于 2020-05-09 12:05:23
问题 Hey its the first time i use JUnit with Java and i'm not sure how to set it up inside Visual studio Code. I tried to put Junit-4.13.jar inside my a lib file in the root directory but nothing changed. any ideas? I am on MacOS. 回答1: There were 2 main issues with this configuration: JUnit 4 dependency jar was used while in the source code imports from JUnit 5 API were used Tests resided in the same location as sources, while the dependencies defined via Gradle/Maven for tests limit the scope to

The import org.junit.jupiter cannot be resolved

自闭症网瘾萝莉.ら 提交于 2020-05-09 12:04:15
问题 Hey its the first time i use JUnit with Java and i'm not sure how to set it up inside Visual studio Code. I tried to put Junit-4.13.jar inside my a lib file in the root directory but nothing changed. any ideas? I am on MacOS. 回答1: There were 2 main issues with this configuration: JUnit 4 dependency jar was used while in the source code imports from JUnit 5 API were used Tests resided in the same location as sources, while the dependencies defined via Gradle/Maven for tests limit the scope to

android studio: no idea annotations attached to the jdk 1.8 some issues will not be found

微笑、不失礼 提交于 2020-05-09 10:49:55
Android Studio今天早上打开项目提示错误信息: No IDEA annotations attached to the JDK 1.8 (C:\Program Files\Android\Android Studio\jre), some issues will not be found 重新打开文件或者重新同步工程都无解,最后在 https://stackoverflow.com/questions/50740240/no-idea-annotations-attached-to-the-jdk-1-8-c-some-issues-will-not-be-fo 找到了解决方案。 解决 首先关闭Android Studio 打开计算机,转到 C:\Users\UserName\.android 文件夹,将 build-cache 文件夹重命名为 build-cache.bak 转到 C:\Users\UserName\.AndroidStudio3.2\system 文件夹,并重命名下面的文件夹: 原文件夹名 重命名后 caches caches.bak compiler compiler.bak compile-server compile-server.bak conversion conversion.bak external_build_system

Spring Boot(十二):Spring Boot 如何测试打包部署

无人久伴 提交于 2020-05-09 06:27:20
有很多网友会时不时的问我, Spring Boot 项目如何测试,如何部署,在生产中有什么好的部署方案吗?这篇文章就来介绍一下 Spring Boot 如何开发、调试、打包到最后的投产上线。 开发阶段 单元测试 在开发阶段的时候最重要的是单元测试了, Spring Boot 对单元测试的支持已经很完善了。 1、在 pom 包中添加 spring - boot - starter - test 包引用 <dependency> <groupId> org.springframework.boot </groupId> <artifactId> spring-boot-starter-test </artifactId> <scope> test </scope> </dependency> 2、开发测试类 以最简单的 helloworld 为例,在测试类的类头部需要添加: @RunWith ( SpringRunner . class ) 和 @SpringBootTest 注解,在测试方法的顶端添加 @Test 即可,最后在方法上点击右键run就可以运行。 @RunWith ( SpringRunner . class ) @SpringBootTest public class ApplicationTests { @Test public void hello () {

自定义view流式布局

五迷三道 提交于 2020-05-08 19:11:18
自定义view流式布局 已经封装依赖可以直接粘贴使用 1.导入依赖 implementation 'com.github.LiHangKun:LiuShiBuJu:1' 然后在项目的build.gradle中 allprojects { repositories { google ( ) jcenter ( ) maven { url 'https://jitpack.io' } //要添加的 } } 2.布局文件 直接使用 < ? xml version = "1.0" encoding = "utf-8" ? > < LinearLayout xmlns : android = "http://schemas.android.com/apk/res/android" xmlns : app = "http://schemas.android.com/apk/res-auto" xmlns : tools = "http://schemas.android.com/tools" android : layout_width = "match_parent" android : layout_height = "match_parent" android : orientation = "vertical" tools : context = ".MainActivity" > <

AS导入Framework.jar

[亡魂溺海] 提交于 2020-05-08 16:28:03
AS导入framework.jar 由于在framework层添加了一些接口,然后又不想每次更改APP都在源码环境下编译验证,特把APP源码拷贝到AS中进行编译修改,这就需要在AS中导入系统编译出来的framework.jar包,才能正常编译。 编译framework.jar包 make -j24编译出framework.jar;并在 out\target\common\obj\JAVA_LIBRARIES\framework_intermediates\目录拷贝出编译好的jar包classes-full-debug.jar。 AS中导入framework.jar包 2.1将拷贝出的classes-full-debug.jar重命名为framework.jar并拷贝到Android工程的libs目录下面。 右键点击jar包,选择add as libary。 2.2打开Module:app 的build.gradle,在dependencies下添加compileOnly files(‘libs/framework.jar’) dependencies { implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint

Android端穿山甲SDK集成

喜夏-厌秋 提交于 2020-05-08 16:27:28
Android端穿山甲SDK集成 SDK接入 穿山甲平台上创建测试状态的应用ID和广告位ID (ps:测试集成完毕后再把应用及对应的代码位改成正式状态) (ps:应用ID和代码位ID是对应关系 一个应用可以对应多个代码位ID) 应用ID 对应demo中的APPID 广告位ID 对应demo中的CodeId 将本SDK压缩包内的open_ad_sdk.aar添加到build.gradle中: repositories { flatDir { dirs 'libs' } } depedencies { compile ( name: 'open_ad_sdk' , ext: ‘aar' ) } 添加权限 < ! --必要权限-- > < uses-permission android:name = "android.permission.INTERNET" / > < ! --可选权限-- > < uses-permission android:name = "android.permission.READ_PHONE_STATE" / > < uses-permission android:name = "android.permission.ACCESS_NETWORK_STATE" / > < uses-permission android:name = "android

CentOS7 nexus 3 搭建maven或gradle 私有代理服务器

女生的网名这么多〃 提交于 2020-05-08 09:26:38
1.下载nexus 3, 选择与操作系统对应版本 2.解压nexus并运行: 3.在浏览器中输入http://192.168.127.128:8081/,并以amdin为用户名,以admin123为密码进行登录: 4.添加仓库地址: 5.创建仓库: 6.选择仓库类型: 7.添加ibiblio仓库 8.把ibiblio仓库添加到public仓库为,对外提供统一代理服务: 9.执行完上面所有步骤后,就可以用下面地址作为maven的代理访问地址: 10.maven配置: 11.gradle的配置: 此处并不是重点讲maven和gradle,具体maven和gradle的配置要自己单独学习maven和gradle的知识。 来源: oschina 链接: https://my.oschina.net/u/4355313/blog/3882739

在Android项目中接入Flutter,在Flutter使用安卓布局

≯℡__Kan透↙ 提交于 2020-05-08 09:23:37
开头 在flutter开发中,始终会有下面两个无法避免的问题: 原生项目往flutter迁移,就需要在原生项目中接入flutter flutter项目中要使用到一些比较成熟的应用,就无法避免去用到原生的各种成熟库,比如音视频之类的 这篇文章,将会对上面两种情况,分别进行介绍 在Android中接入flutter界面 在android项目中需要将flutter以module的形式接入 创建flutter module 进入当前android项目,在根目录运行如下命令: flutter create -t module my_flutter 上面表示创建一个名为 my_flutter 的flutter module 之后运行 cd my_flutter cd .android/ ./gradlew flutter:assembleDebug 同时,确保你的在你的android项目目录下 app/build.gradle ,有添加如下代码: android { compileSdkVersion 28 defaultConfig { ... } buildTypes { ... } //flutter相关声明 compileOptions { sourceCompatibility 1.8 targetCompatibility 1.8 } } 接着,在 android项目 根目录下的