2 poopooptt poopooptt 于 2018.08.10 18:03 提问

adnroid 开发编译mqtt报错 5C

android studio 下载并打开paho.mqtt.android 编译报错,我的gradle版本4.4 as版本3.1.3
下载地址https://github.com/eclipse/paho.mqtt.android

直接git到的原始的项目,打开编译就报错,我本地新建空内容项目都能编译成功,adnroid 开发编译mqtt报错×

报错如下:

Cannot create variant 'android-lint' after configuration ':org.eclipse.paho.android.service:debugRuntimeElements' has been resolved
图片说明

org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring project ':org.eclipse.paho.android.service'.
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:139)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:109)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:53)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
。。。
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring project ':org.eclipse.paho.android.service'.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:137)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:109)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:53)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
。。。
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':org.eclipse.paho.android.service'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:89)
。。。
... 62 more
Caused by: org.gradle.api.InvalidUserCodeException: Cannot create variant 'android-lint' after configuration ':org.eclipse.paho.android.service:debugRuntimeElements' has been resolved
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationPublications$ConfigurationVariantFactory.create(DefaultConfigurationPublications.java:158)
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationPublications$ConfigurationVariantFactory.create(DefaultConfigurationPublications.java:151)
at org.gradle.api.internal.FactoryNamedDomainObjectContainer.doCreate(FactoryNamedDomainObjectContainer.java:100)
at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:67)
at com.android.build.gradle.internal.scope.VariantScopeImpl.lambda$publishArtifactToConfiguration$2(VariantScopeImpl.java:378)
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationPublications.variants(DefaultConfigurationPublications.java:139)
at com.android.build.gradle.internal.scope.VariantScopeImpl.publishArtifactToConfiguration(VariantScopeImpl.java:376)
at com.android.build.gradle.internal.scope.VariantScopeImpl.publishIntermediateArtifact(VariantScopeImpl.java:347)
at com.android.build.gradle.internal.scope.VariantScopeImpl.addTaskOutput(VariantScopeImpl.java:298)
at com.android.build.gradle.internal.TaskManager.configureGlobalLintTask(TaskManager.java:536)
at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:7

1个回答

qq_33679312
qq_33679312   2018.08.11 12:11

最新版本之间有冲突吧 版本调低一点试试?

compile 换成 implementation

classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
mqtt的开源实现mosquitto的交叉编译与使用
mqtt协议是最近比较流行的即时推送的协议 到 http://mosquitto.org/download/ 下载源码 或者跟我一样我直接下git $ git clone git://git.eclipse.org/gitroot/mosquitto/org.eclipse.mosquitto.git $ cd  org.eclipse.mosquitto/ 编译pc平台的 $ ma
编译Spark出现MQTT失败的解决
编译spark的时候一直在MQTT哪里出错,看一下具体所报的错。 [INFO]------------------------------------------------------------------------ [INFO] Building Spark Project External MQTT1.5.2 [INFO]------------------------------
搭建windows平台下的MQTT平台
1.下载Apollo服务器,下载地址http://activemq.apache.org/apollo/download.html,选择window版本下载。下载到桌面并且解压。通过命令行进入这个文件夹中,运行在apache-apollo-1.7.1\bin\中的apollo.cmd文件,在后面加上参数create mybroker即可创建一个服务器实例。如果创建失败,运行不正常,需要检查电脑是否...
MQTT源码交叉编译与移植
基于MQTT源码的嵌入式LINUX移植,网上可参看资料几乎没有,估计是用的不多,没什么人弄,又或者 太简单,没人写参考。这里记录下编译与移植过程。大致有三部分,交叉编译openssl、交叉编译MQTT、安装MQTT服务器。 1 交叉编译OPENSSL 因为MQTT用到OPENSSL库,所以编译MQTT的时候要先编译OPENSSL。解压源文件,创建openssl安装目录,配置o
openwrt系统+ 交叉编译mosquitto
1.下载最新的mosquitto.1.4.10.tar.gz的源码 2.解压,打开config.mk。在文件顶部添加如下 CC=mipsel-openwrt-linux-gcc CXX=mipsel-openwrt-linux-g++ CPP=mipsel-openwrt-linux-g++ AR=mipsel-openwrt-linux-ar  LD=mipsel-openw
开发 mqtt 遇到的坑
搭建了基于mtk featurephone 的mqtt做采集器,采用了java 做 mqtt的做服务器,发现mqtt对语音类的交互还是有问题。     mqtt 适合传输小的数据 因为对于大数据,传输会丢包,甚至传输不出去;   mqtt 适合传输实时性不高的数据 因为数据要多次确认,其实在tcp底层已经有ack了,所以导致传输数据如果速度有要求,会导致延迟很大。...
MQTT在linux下环境下的编译与配置
安装的方法参照
QT移植MQTT
移植MQTT到QT环境中 一、项目下载链接
基于mini2440嵌入式linux上整合一套Domoticz智能家居系统(七)交叉编译paho.mqtt.embedded-c库和嵌入式linux样例程序
本篇将把paho.mqtt.embedded-c官方的源代码交叉编译成数据包封装库和应用程序两部分,并把样例应用程序在mini2440上运行。
MQTT在OPENWRT下的测试例子
1. 在opnwrt下 先安装 mosquitto 2.   终端输入 mosquitto_sub  -t mqtt 2.  电脑端输入 mosquitto_sub -h 192.168.202.88 -t mqtt "hellowld" 可以参考这个 https://my.oschina.net/u/1396253/blog/175773