- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Android 应用程序开发的新手,这个月我正在使用 Android Studio。之前,我创建了很多项目都没有任何问题。这是我在创建新项目时收到此奇怪错误的两天:
Error:Unable to find method 'org.apache.http.impl.client.DefaultHttpClient.setRedirectStrategy(Lorg/apache/http/client/RedirectStrategy;)V'.
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
我也卸载了 android studio 并重新安装它,但仍然无法正常工作,而且我之前的项目也无法在这个新的 android studio 上运行。
这是我的 build.gradle 的样子:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
android {
compileSdkVersion 22
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 21
targetSdkVersion 21
}
productFlavors {
}
}
dependencies {
}
最佳答案
我想,您正在尝试使用已经不受支持的库
HttpClient
在 sdk 23 中不再被支持。
您必须使用 URLConnection
或降级到 sdk 22 (compile 'com.android.support:appcompat-v7:22.2.0'
)
如果您需要 SDK 版本 23,请将其添加到您的 build.gradle
:
android {
useLibrary 'org.apache.http.legacy'
}
您也可以尝试下载并包含 HttpClient jar直接进入您的项目或使用 OkHttp相反。
如果您需要更多信息,请同时查看相关主题:
编辑:根据 How to exclude libraries from all dependencies in Gradle
configurations {
compile.exclude group:'ch.qos.logback'
}
或
configurations {
// to avoid double inclusion of support libraries
all*.exclude group: 'com.android.support', module: 'support-v4'
}
检查这个:android studio: gradle dependency error
希望对你有帮助
基于这些解释,解决方案是为我(在 mac 上)从 java exra 库中删除 httpClients 库,形式如下: /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/lib/ext
关于java - android studio 创建新项目失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34622552/
我有一个 Outlook 加载项,它是一个新的功能区选项卡,它连接到我的服务器数据库,用于将一些自定义数据与 Outlook 对象相关联。 此功能区选项卡目前显示在邮件项目中。 我正在扩展它以在任务和
我已经使用 MVC 从头开始创建了多个站点,但现在我的任务是迁移项目。 目前该站点有一个大型静态文件库 (*.html)。最终每个页面都将迁移到带有 View 和 Controller 的 MVC
我已经使用 Netbeans 几个月了并且非常喜欢它。我正在尝试启用一种方法来创建一个项目,该项目访问我服务器上的实时文件以进行更改。当我使用远程源创建项目时,它开始将所有服务器文件下载到我的计算机。
我想创建一个java项目(非Web)来利用Spring的特性,如依赖注入(inject)、事务数据、 Autowiring 等, 我想使用的一些功能: @服务 @Autowired @存储库 @事务性
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我正在尝试在 Windows 10 上使用 Angular-cli 创建一个 Angular 4 项目。 我按照https://www.npmjs.com/package/@angular/cli中提
我正在开发小型 Android 应用程序,我想在 ListView 上显示新添加的项目。我正在从存储在 ArrayList>() 中的数据库中获取项目。因为我使用了 SimpleAdapter 。我将
我在商店中有一个带有 CoreData 模型的应用程序,我想完全更改该应用程序(删除一些垃圾、组织、新的 CoreData 模型...等)。 所以我想重新开始并创建新项目,当我尝试将商店中的旧应用程序
全新安装 Phoenix,我尝试触发一个新项目,当我尝试运行服务器时,我遇到了: Unchecked dependencies for environment dev: * gettext (Hex
在安装了必要的包“node.js”后,我试图创建一个新的 react 项目,我按照教程中的指导运行了用于创建应用程序的代码,但应用程序没有创建。这是收到的错误消息。 $ npm install -g
我想听听你的建议。可以添加新项目以右键单击 OSX 吗?例如,我在 safari、TextEdit、Notes、Pages、Preview 中选择任何单词,我想将这个单词发送到服务器并获得响应。有可能
我正在尝试创建一个新项目,并且我想使用 NHibernate(特别是 Fluent NHibernate)。 我学习一项新技术的最大问题就是设置它,我在这方面遇到了很多困难。我开始看这个 (http:
我正在开始我的第一家独立营利企业。我很难决定使用哪种语言。我想用 Perl 编写我的应用程序,但我认为编译起来不够简单。如果我不用 Perl 编写,我会用 C++ 编写。 该应用程序将具有许多功能,包
我在工作中开始一个新的客户端/服务器项目,我想开始使用一些我一直在阅读的新技术,LINQ 和泛型是主要技术。到目前为止,我一直在使用 MySQL 开发这些类型的应用程序,因为客户不愿意为 MSSQL
我要为我的另一半开始一个项目;根据特定标准搜索考古图像的能力。 搜索这些条件的能力就在我的街道上,一个与某些元数据相关联的图像(或其文件路径)数据库。该界面将允许搜索元数据,然后显示带有缩略图 Vie
我觉得我要为此疯狂了。 我正在尝试使用 Foundation 5 开始一个新项目,但我遇到了一个与我的 git 存储库相关的非常奇怪的问题。我之前一直在使用 Foundation 4,我已经检查过我是
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题吗? 更新问题,以便 editing this post 提供事实和引用来回答它. 关闭 5 年前。 Improve
当我在 Intellij 中创建一个新项目时,我收到了这些错误消息,我真的不知道如何缓解或解决这个问题。 我目前使用的是 Intellij IDEA 15 有人知道这个错误吗? Unknown Err
我会假设这只是意味着我缺少依赖项,但我无法创建任何类型的项目(控制台应用程序、Web 应用程序、Windows 窗体等)。我正在运行 VS 2012 premium。 最佳答案 您可能正试图将您的项目
摘要 有人知道当建议中不存在输入的内容时如何让 UI Fabric React TagPicker 添加新项目吗? 我还想向服务发送 AJAX 请求,以便在后端添加新项目。 所需功能 当有人在选择器中
我是一名优秀的程序员,十分优秀!