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源码交叉编译与移植
基于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
vc2015编译paho.mqtt.c-1.1.0
vc2015打开“\paho.mqtt.c-1.1.0\Windows Build\Paho C MQTT APIs.sln” 将文件“\paho.mqtt.c-1.1.0\src\VersionInfo.h.in”另存为“\paho.mqtt.c-1.1.0\src\VersionInfo.h” 编译
OpenWRT MQTT
opkg updateopkg install mosquitto mosquitto-client libmosquitto
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
编译安装 MQTT mosquitto 遇到的问题和解法
从官网(http://mosquitto.org/download/)下载了 1.3.5 的版本,解压后编译失败 :~/Downloads/mosquitto-1.3.5$ make set -e; for d in lib client src; do /Applications/Xcode.app/Contents/Developer/usr/bin/make -C ${d}; don
基于mini2440嵌入式linux上整合一套Domoticz智能家居系统(七)交叉编译paho.mqtt.embedded-c库和嵌入式linux样例程序
本篇将把paho.mqtt.embedded-c官方的源代码交叉编译成数据包封装库和应用程序两部分,并把样例应用程序在mini2440上运行。
MQTT在linux下环境下的编译与配置
安装的方法参照
编译Spark出现MQTT失败的解决
编译spark的时候一直在MQTT哪里出错,看一下具体所报的错。 [INFO]------------------------------------------------------------------------ [INFO] Building Spark Project External MQTT1.5.2 [INFO]------------------------------
qt for mqtt 客户端
1、源码下载:https://github.com/emqtt/qmqtt/tree/master。 2、解压安装包。 3、构建SRC文件(编译源码)。 4、在C盘根目录生成lib、include文件夹(为什么生在这,目前还不知道在哪里设置)。 5、将include文件夹加上src里面的头文件,再将其复制到项目工程目录下;将lib文件夹也拷贝至项目工程目录下;DLL文件拷贝至项目deBug