gpt4 book ai didi

java - 导入附加库后 Android Studio gradle 错误 - smack

转载 作者:行者123 更新时间:2023-11-30 03:33:51 25 4
gpt4 key购买 nike

我有一个奇怪的错误,我找不到答案。

在我的类上做了一些导入之后(下面的代码)

    package info.zajacmp3.servercommunication;

import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;

/**
* Created by Mateusz on 04.06.13.
*/
public class ServerCommunication {



public static boolean isSendableOverInternet(){
return false;
}
}

我得到了 gradle 错误:

Gradle: 
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':PPMMessenger:compileDebug'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

当我运行堆栈跟踪时,它什么也没告诉我...因为没有跟踪到我的代码。

这是堆栈跟踪:

* Try:
Run gradlew tasks to get a list of available tasks.

* Exception is:
org.gradle.execution.TaskSelectionException: Task 'compileDebug' not found in ro
ot project 'Mateusz'.
at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:67)
at org.gradle.execution.commandline.CommandLineTaskParser.parseTasks(Com
mandLineTaskParser.java:41)
at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.doSele
ct(TaskNameResolvingBuildConfigurationAction.java:65)
at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.config
ure(TaskNameResolvingBuildConfigurationAction.java:47)
at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecu
ter.java:42)
at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExec
uter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecu
ter.java:48)
at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.co
nfigure(ExcludedTaskFilteringBuildConfigurationAction.java:46)
at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecu
ter.java:42)
at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExec
uter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecu
ter.java:48)
at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(Defau
ltTasksBuildExecutionAction.java:38)
at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecu
ter.java:42)
at org.gradle.execution.DefaultBuildExecuter.select(DefaultBuildExecuter
.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default
GradleLauncher.java:155)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle
Launcher.java:113)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun
cher.java:81)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon
troller.run(InProcessBuildActionExecuter.java:64)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav
a:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav
a:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
ssBuildActionExecuter.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
ssBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions
.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
CommandLineActionFactory.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
CommandLineActionFactory.java:139)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
ortingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
ortingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:39)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots
trap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j
ava:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.ja
va:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)


BUILD FAILED

Total time: 2.368 secs

感谢任何帮助。我在这里看不到任何可以帮助我自己解决这个问题的东西。

最佳答案

刚遇到这个问题,我需要将自定义 jar 库添加到 build.gradle 文件中:

dependencies {
compile files('libs/android-support-v4.jar')
ADD FILE HERE
}

关于java - 导入附加库后 Android Studio gradle 错误 - smack,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16959660/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com