gradle

Android | Android Studio打包APK安装失败:应用是非正式版本,当前设备不支持安装

拜拜、爱过 提交于 2020-08-20 06:19:28
异常情况: Android studio 打包apk后发给别人,安装失败。 失败原因显示:应用是非正式发布版本,当前设备不支持安装。 在自己手机上也无法安装,之后连接USB进行调试时可以运行,打包成APK安装就会显示下图错误: 原因分析: 造成该问题的原因是Android Studio 3.0会在debug apk的manifest文件application标签里自动添加 android:testOnly="true"属性。该属性导致在IDE中使用Run生成的apk在大部分手机上只能用adb install -t 来安装。 这种apk在某些手机上甚至安装不了。 解决方法: 在gradle.properties 文件中添加如下指令: android.injected.testOnly=false 来源: oschina 链接: https://my.oschina.net/u/4311839/blog/4407435

Spring Boot 2.X系列教程:七天从无到有掌握Spring Boot-持续更新

≡放荡痞女 提交于 2020-08-20 05:07:04
简介 自从Spring横空出世之后,Spring就成了事实上的J2EE标准。Spring作为一个轻量级的J2EE应用框架,就是针对EJB的复杂特性而设计的,最后毫无疑问,Spring凭借它的简洁,可理解性和可用性赢得了最后的胜利。 Spring从最初的xml配置到后面的注解配置,一直都在不断的进步,但是可不可以,能不能够有一种方法可以不要配置就能运行Spring应用程序?于是Spring Boot应运而生。 更多内容请访问 www.flydean.com SpringBoot是由Pivotal团队在2013年开始研发、2014年4月发布第一个版本的全新开源的轻量级框架。 Spring Boot让你的企业级应用更加容易编写,更加容易运行。并且集成了很多常用的第三方lib库,免去了大家手动引用配置的麻烦。 使用最简单的配置运行最复杂的Spring应用程序,应该就是Spring Boot的终极目标。 同时Spring Boot尽可能的摆脱xml配置,能够提供包括独立运行,服务器内部运行等各种运行方式,方便我们的使用。 Spring Boot的基本操作 最新的Spring Boot版本是2.3.0.RELEASE,它需要至少JDK8的支持和Spring Framework 5.2.6.RELEASE。 在构建工具方面,需要Maven 3.3+ 和 Gradle 6.3+。 服务器方面

Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: No outputs for

最后都变了- 提交于 2020-08-19 21:57:33
错误:Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: No outputs for the main artifact of variant: debug 前言:最近在做新浪微博第三方登录,下载了官方的demo,运行时报出以上错误。 找到了这篇文章: Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: No outputs for 但是并不能解决我的问题,又看了该文章下方的评论,又结合自身的情况,终于解决。 解决办法: 1、首先选择Edit Configurations进入设置界面; 2、按图选择即可,最后确定保存设置。 上述解决方法可能不报错,但是也会无法运行,根本原因还是Gradle的问题。 3、修改gradle设置; 参照自己本地运行成功的项目修改 项目的build.gradle文件、app的build.gradle文件、gradle.properties文件。 以下文件是我自己的,大家结合自己的实际情况修改。 3.1、项目的build.gradle文件 buildscript { repositories { google()

Android Studio打包apk自动获取SVN号、时间、版本号、版本名称

雨燕双飞 提交于 2020-08-19 13:47:44
备注:打包之前一定要记得首先从svn update一下代码 这样才能保证打包的svn号是当前最新的SVN号 一、根目录下build.gradle文件配置 // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { mavenCentral() google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.3' classpath "org.tmatesoft.svnkit:svnkit:1.8.11"//1.添加此处 } } allprojects { repositories { mavenCentral() google() jcenter() maven { url "https://jitpack.io" } } } task clean(type: Delete) { delete rootProject.buildDir } 二、app中的build.gradle文件配置 apply plugin: 'com.android.application' import org

How to tell Gradle to use --console=plain all the time?

我怕爱的太早我们不能终老 提交于 2020-08-19 11:23:02
问题 I am using gradle from a slightly unorthodox terminal, so Gradle's traditional "pretty" output does not work. Is there a way I can specify in ~/.gradle/gradle.properties that --console=plain should be used for every gradle command? 回答1: Since Gradle 4.3 you can add a line to a file called gradle.properties in your project's root directory: org.gradle.console=plain If you really need to make this system-wide (not just project-wide), you could make an alias for your gradle command, i.e on Linux

How to tell Gradle to use --console=plain all the time?

大兔子大兔子 提交于 2020-08-19 11:21:14
问题 I am using gradle from a slightly unorthodox terminal, so Gradle's traditional "pretty" output does not work. Is there a way I can specify in ~/.gradle/gradle.properties that --console=plain should be used for every gradle command? 回答1: Since Gradle 4.3 you can add a line to a file called gradle.properties in your project's root directory: org.gradle.console=plain If you really need to make this system-wide (not just project-wide), you could make an alias for your gradle command, i.e on Linux

“AndroidManifest.xml doesn't exist or has incorrect root tag” Error

喜夏-厌秋 提交于 2020-08-19 11:18:36
问题 I am new to AndroidStudio AND Gradle. I imported a project from eclipse, created a module, and tried to run the project, but I got this error: AndroidManifest.xml doesn't exist or has incorrect root tag I have been looking at this previous solution for it: How to build an android library with Android Studio and gradle? But that solution is WAY too advanced for me. Could someone please help me understand in simpler terms what is going wrong and how I can fix it? Thank you! Update after one of

“AndroidManifest.xml doesn't exist or has incorrect root tag” Error

筅森魡賤 提交于 2020-08-19 11:15:24
问题 I am new to AndroidStudio AND Gradle. I imported a project from eclipse, created a module, and tried to run the project, but I got this error: AndroidManifest.xml doesn't exist or has incorrect root tag I have been looking at this previous solution for it: How to build an android library with Android Studio and gradle? But that solution is WAY too advanced for me. Could someone please help me understand in simpler terms what is going wrong and how I can fix it? Thank you! Update after one of

Elasticsearch源码解析:环境搭建

寵の児 提交于 2020-08-19 05:39:47
在之前学习Redis的过程中,我就是一边通过文档/视频学习,一边阅读源码。我发现两种方法可以相辅相成,互相补充。阅读文档可以帮助我们快速了解某个功能,阅读源码有助于我们更深入的理解这一功能的实现及思想。 因此,在学习 Elasticsearch 的时候我也准备采用这样的模式。所以,从今天开始,我会定期更新学习 Elasticsearch 源码的收获。在开始学习之前,需要先把环境准备好。所以今天就先分享一下准备环境的过程。 软件环境 Intellij Idea:2020.1版本 JDK 12 Gradle 5.5 下载源码 你可以在 Github 中下载 release 版本或指定 tag 的源码,地址如下。 https://github.com/elastic/elasticsearch/releases 下载好以后解压到指定目录/ tar -xzvf elasticsearch-7.3.1.tar.gz 也可以直接在命令行通过 git 下载源码 git clone git@github.com:elastic/elasticsearch.git 然后可以切换到你想要的版本 git checkout v7.3.1 导入IntelliJ IDEA 下载好源码以后,我们来将项目导入 IDEA,首先,进入到项目的根目录,执行命令 ./gradlew idea 这一步是生成

ContentResolver query method cannot be used, NoSuchMethodError

送分小仙女□ 提交于 2020-08-18 21:02:53
问题 I am creating an app that reads the phone contacts of your phone. However, for reasons that I don't know, I have a problem using the query method because of the api version that I used. It says that Call requires API level 26 (current min is 16): android.content.ContentResolver#query . Here's my code I used in the oncreate method. public void searchContacts() { ContentResolver contentResolver = getContentResolver(); Cursor cursor = contentResolver.query(ContactsContract.Contacts.CONTENT_URI,