问题描述
我试图在CentOS机器中构建一个Android项目作为持续集成的一部分。
开发团队在Windows中构建,并且在他们的机器中工作正常。
在CentOS机器中,我看到下面的错误。任何想法出了什么问题。下面是堆栈跟踪。
我在gradle.properties中设置了代理信息。
我已经设置了Android构建工具和平台工具。
*出错:
配置项目':app'时发生问题。
> java.lang.NullPointerException(无错误消息)
*尝试:
使用--info或--debug选项运行以获取更多日志输出。
*例外情况是:
org.gradle.api.ProjectConfigurationException:配置项目':app'时发生问题。
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:89)
在在org.gradle.configuration.project.LifecycleProjectEvaluator.access $ 000(LifecycleProjectEvaluator.java:33)$ b $在组织b org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:76)
。在org.gradle.configuration.project.LifecycleProjectEvaluator $ 1.execute gradle.configuration.project.LifecycleProjectEvaluator $ 1.execute(LifecycleProjectEvaluator.java:53)
(LifecycleProjectEvaluator.java:50)
。在org.gradle。 internal.Transformers $ 4.transform(Transformers.java:169)
在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
在org.gradle.internal.progress.Defau ltBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
位于org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50)
位于org.gradle.api.internal.project.DefaultProject。评估(DefaultProject.java:628)
在org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:129)
在org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator。的java:在org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62 35)
)
。在org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
在org.gradle.initialization.DefaultGradleLauncher $ 1.execute(DefaultGradleLauncher.java:161)
在org.gradle.initialization.DefaultGradleLauncher $ 1.execute(DefaultGradleLauncher.java:158)
在org.gradle.internal .Transformers $ 4.transform(Transformers.java:1 69)
在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
。在org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:158)
在org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
在org.gradle.initialization .DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
在org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
在org.gradle.tooling.internal.provider.ExecuteBuildActionRunner .run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter .java:41)
在org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
在org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
。在组织.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
at org .gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
在org.gradle.launcher.dae mon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org。 gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
。在org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120 )
at org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call (ForwardClientInput.java:72)
在org.gradle.util.Swapper.swap(Swapper.java:38)
在org.gradle.launcher.dae mon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org。 gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36 )美元,org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120 b $ b)
在org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment .java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher .daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy $ 1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator $ 1.run(DaemonStateCoordinator.java:297)
在org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
在org.gradle.internal.concurrent.StoppableExecutorImpl $ 1.run(StoppableExecutorImpl.java:40)
引起:java.lang.NullPointerException
在com.android.builder.sdk.DefaultSdkLoader.updateRepositories(DefaultSdkLoader .java:455)
at com.android.build.gradle.internal.DependencyManager.collectArtifacts(DependencyManager.java:550)
at com.android.build.gradle.internal.DependencyManager.gatherDependencies(DependencyManager .java:385)
at com.android.build.gradle.internal.DependencyManager.resolveD ependencyForConfig(DependencyManager.java:288)
at com.android.build.gradle.internal.DependencyManager.resolveDependencies(DependencyManager.java:159)
at com.android.build.gradle.internal.TaskManager。 resolveDependencies(TaskManager.java:364)
at com.android.build.gradle.internal.VariantManager $ 9.call(VariantManager.java:636)
at com.android.build.gradle.internal.VariantManager $ 9.call(VariantManager.java:633)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.builder.profile.ThreadRecorder.record( ThreadRecorder.java:120)
at com.android.build.gradle.internal.profile.SpanRecorders.record(SpanRecorders.java:44)
at com.android.build.gradle.internal.VariantManager。 createVariantData(VariantManager.java:629)
at com.android.build.gradle.internal.VariantManager.createVariantDataForProductFlavors(VariantManager.java:823)
at com.an droid.build.gradle.internal.VariantManager.populateVariantDataList(VariantManager.java:494)
at com.android.build.gradle.internal.VariantManager $ 1.call(VariantManager.java:269)
at com .android.build.gradle.internal.VariantManager $ 1.call(VariantManager.java:266)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com。 android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
at com.android.build.gradle.internal.VariantManager.createAndroidTasks(VariantManager.java:265)
at com.android。 build.gradle.BasePlugin $ 11.call(BasePlugin.java:688)
at com.android.build.gradle.BasePlugin $ 11.call(BasePlugin.java:685)
at com.android.builder。 profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
at com.android.build.gradle.BasePlugin。 createAndroidTasks(BasePlug in.java:683)
at com.android.build.gradle.BasePlugin $ 10.call(BasePlugin.java:608)
at com.android.build.gradle.BasePlugin $ 10.call(BasePlugin。
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
at com.android.build.gradle.BasePlugin.lambda $ createTasks $ 1(BasePlugin.java:603)
at org.gradle.internal.event.BroadcastDispatch $ ActionInvocationHandler.dispatch(BroadcastDispatch.java:93 )
at org.gradle.internal.event.BroadcastDispatch $ ActionInvocationHandler.dispatch(BroadcastDispatch.java:82)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
在org.gradle.internal.dispatch.ProxyDispatchAdapter $ DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy。$ Proxy15.afterEvaluate(Unknown Source)
at org.gradle.configuration .project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:82)
... 56 more
BUILD FAILED
构建应用程序模块的渐变。
apply plugin:'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion25.0.2
defaultConfig {
applicationIdau.com.company.appname
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName1.0
testInstrumentationRunnerandroid.support.test.runner.AndroidJUnitRunner
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
useLibrary'org.apache.http.legacy'
}
依赖{
编译fileTree(包括:''.jar'],dir:'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core :2.2.2',{
exclude group:'com.android.support',module:'support-annotations'
})
//添加解码库
//读取更多功能库
编译'com.google.maps.android:android-maps-utils:0.5'
compile'at.blogc:expandabletextview:1.0.3'
compile'com.android.support:appcompat-v7:25.3.1'
compile'com.android.support.constraint:constraint- layout:1.0.2'
compile'com.android.support:design:25.3.1'
compile'com.android.support:support-v4:25.3.1'
compile' com.google.android.gms:play-services-maps:11.0.1'
compile'com.google.android.gms:play-services-location:11.0.1'
compile'com。 google.android.gms:play-services-plus:11.0.1'
compile'com.google.vr:sdk-base:1.10.0'
compile'com.google.vr:sdk- common:1.10.0'
compile'com.google.vr:sdk-commonwidget:1.10.0'
compile'com.google.vr:sdk-panowidget:1.10.0'
编译'com.google.android.gms:play-services-analytics:11.0。 1'
compile'com.facebook.android:facebook-android-sdk:4.15.0'
testCompile'junit:junit:4.12'
}
更新1
我跟着这个链接并在$ ANDROID_HOME / platforms中创建gradle.properties / b>
现在我收到了这个错误。
准备安装SDK Patch Applier v4。
警告:准备SDK包补丁应用程序v4时发生错误:无法通过代理进行隧道传输。代理返回HTTP / 1.1 407代理验证必需。:
java.io.IOException:无法通过代理进行隧道传输。代理在sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2124)
在sun.net.www.protocol.https返回HTTP / 1.1 407 Proxy Proxy Required
.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
在sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
在com.android.sdklib.repository.legacy .remote.internal.DownloadCache.openUrl(DownloadCache.java:245)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openDirectUrl(DownloadCache.java:338)
at com .android.sdklib.repository.legacy.LegacyDownloader.downloadFully(LegacyDownloader.java:79)
at com.android.repository.impl.downloader.LocalFileAwareDownloader.downloadFully(LocalFileAwareDownloader.java:81)
at com .android.repository.impl.installer.BasicInstaller.doPrepare(BasicInstaller.java:71)
at com.andro id.repository.impl.installer.AbstractPackageOperation.prepare(AbstractPackageOperation.java:243)
处com.android com.android.builder.sdk.DefaultSdkLoader.installRemotePackages(DefaultSdkLoader.java:325)
。 builder.sdk.DefaultSdkLoader.updateRepositories(DefaultSdkLoader.java:458)
at com.android.build.gradle.internal.DependencyManager.collectArtifacts(DependencyManager.java:550)
at com.android.build。 gradle.internal.DependencyManager.gatherDependencies(DependencyManager.java:385)
at com.android.build.gradle.internal.DependencyManager.resolveDependencyForConfig(DependencyManager.java:288)
com.android.build。 gradle.internal.DependencyManager.resolveDependencies(DependencyManager.java:159)
at com.android.build.gradle.internal.TaskManager.resolveDependencies(TaskManager.java:364)
at com.android.build。 gradle.internal.VariantManager $ 9.call(VariantManager.java:636)
at com.androi d.build.gradle.internal.VariantManager $ 9.call(VariantManager.java:633)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android .builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
at com.android.build.gradle.internal.profile.SpanRecorders.record(SpanRecorders.java:44)
at com.android .build.gradle.internal.VariantManager.createVariantData(VariantManager.java:629)
at com.android.build.gradle.internal.VariantManager.createVariantDataForProductFlavors(VariantManager.java:823)
at com.android .build.gradle.internal.VariantManager.populateVariantDataList(VariantManager.java:494)
at com.android.build.gradle.internal.VariantManager $ 1.call(VariantManager.java:269)
at com。 android.build.gradle.internal.VariantManager $ 1.call(VariantManager.java:266)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
at com.android.build.gradle.internal.VariantManager.createAndroidTasks(VariantManager.java:265)
at com .android.build.gradle.BasePlugin $ 11.call(BasePlugin.java:688)
at com.android.build.gradle.BasePlugin $ 11.call(BasePlugin.java:685)
at com.android .builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
at com.android.build.gradle .BasePlugin.createAndroidTasks(BasePlugin.java:683)
at com.android.build.gradle.BasePlugin $ 10.call(BasePlugin.java:608)
at com.android.build.gradle.BasePlugin $ 10 .call(BasePlugin.java:605)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder .java:120)
在com.android.build .gradle.BasePlugin.lambda $ createTasks $ 1(BasePlugin.java:603)
at org.gradle.internal.event.BroadcastDispatch $ ActionInvocationHandler.dispatch(BroadcastDispatch.java:93)
at org.gradle。 internal.event.BroadcastDispatch $ ActionInvocationHandler.dispatch(BroadcastDispatch.java:82)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
at org.gradle.internal。 event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
at org.gradle.internal.dispatch.ProxyDispatchAdapter $ DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy。$ Proxy15.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java: 82)
在org.gradle.configuration.project.LifecycleProjec tEvaluator.doConfigure(LifecycleProjectEvaluator.java:76)
。在org.gradle.configuration.project.LifecycleProjectEvaluator.access $ 000(LifecycleProjectEvaluator.java:33)
。在1 org.gradle.configuration.project.LifecycleProjectEvaluator $。执行(LifecycleProjectEvaluator.java:53)
在org.gradle.configuration.project.LifecycleProjectEvaluator $ 1.execute(LifecycleProjectEvaluator.java:50)
在org.gradle.internal.Transformers $ 4.transform(变形金刚。 Java的:169)美元,org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106 b $ b)
在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:628)
在org.gradle.api.internal.proj ect.DefaultProject.evaluate(DefaultProject.java:129)
在org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
在org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator。的java:在org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38 62)
)
。在org.gradle.initialization.DefaultGradleLauncher $ 1.execute(DefaultGradleLauncher.java:161)
在org.gradle.initialization.DefaultGradleLauncher $ 1.execute(DefaultGradleLauncher.java:158)
在org.gradle.internal.Transformers $ 4.transform(Transformers.java:169)
在org.gradle。在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)处为
,在org.gradle.initialization.DefaultGradleLauncher处为
。 doBuildStages(DefaultGr adleLauncher.java:158)
在org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
在org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
。在org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
在org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
在org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
在org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
在org.gradle .launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
at org.gradle.tooling .internal.provider.ContinuousBuildActionExecuter.execute( ContinuousBuildActionExecuter.java:49)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute( ServicesSetupBuildActionExecuter.java:29)
位于org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
位于org.gradle.launcher.daemon.server.exec。 BuildCommandOnly.execute(BuildCommandOnly.java:36)
位于org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
位于org.gradle.launcher.daemon。在org.gradle上
。 launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
在org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput。 java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java :38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed (DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.laun cher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
。在org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java :36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy $ 1。运行(StartBuildOrRespondWithBusy.java:50)
在org.gradle.launcher.daemon.server.DaemonStateCoordinator $ 1.run(DaemonStateCoordinator.java:297)
在org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
在org.gradle.internal.concurrent.StoppableExecutorImpl $ 1.run(StoppableExecutorImpl.java:40)
。在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)$ java.util.concurrent.ThreadPoolExecutor
$ Worker.run(ThreadPoolExecutor.java:624)$ b $ at java.lang.Thread。运行(Thread.java:748)
安装SDK Patch Applier v4失败。
*出错:
配置项目':app'时发生问题。
>未能安装以下SDK组件:
[Android支持信息库,Google信息库]
请使用Android Studio中的SDK管理器安装缺失的组件。
解决方案Android Support Repository和Google Repository使用下面的命令并且现在构建工作正常。
/ opt / android-sdk / tools / bin / sdkmanager --no_https --proxy = http --proxy_host = 127.0.0.1 --proxy_port = 3128extras; google; m2repository
/ opt / android-sdk / tools / bin / sdkmanager --no_https --proxy = http --proxy_host = 127.0.0.1 --proxy_port = 3128extras; android; m2repository
虽然这对时间有好处,但我会很乐意听到有人能够指出我们如何设置代理,以便在构建过程中自动下载包。
感谢,
VishnuI am trying to build a Android project in CentOS machine as part of Continuous Integration.
Dev team builds in Windows and it works fine in their machine.In CentOS machine, I am seeing below error. Any idea what is going wrong. Below is the stacktrace.
I have set proxy info in gradle.properties.
I have setup Android build tools and platform tools.* What went wrong: A problem occurred configuring project ':app'. > java.lang.NullPointerException (no error message) * Try: Run with --info or --debug option to get more log output. * Exception is: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'. at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:89) at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:76) at org.gradle.configuration.project.LifecycleProjectEvaluator.access$000(LifecycleProjectEvaluator.java:33) at org.gradle.configuration.project.LifecycleProjectEvaluator$1.execute(LifecycleProjectEvaluator.java:53) at org.gradle.configuration.project.LifecycleProjectEvaluator$1.execute(LifecycleProjectEvaluator.java:50) at org.gradle.internal.Transformers$4.transform(Transformers.java:169) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50) at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:628) at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:129) at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35) at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38) at org.gradle.initialization.DefaultGradleLauncher$1.execute(DefaultGradleLauncher.java:161) at org.gradle.initialization.DefaultGradleLauncher$1.execute(DefaultGradleLauncher.java:158) at org.gradle.internal.Transformers$4.transform(Transformers.java:169) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:158) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102) at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71) at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49) at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44) at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) Caused by: java.lang.NullPointerException at com.android.builder.sdk.DefaultSdkLoader.updateRepositories(DefaultSdkLoader.java:455) at com.android.build.gradle.internal.DependencyManager.collectArtifacts(DependencyManager.java:550) at com.android.build.gradle.internal.DependencyManager.gatherDependencies(DependencyManager.java:385) at com.android.build.gradle.internal.DependencyManager.resolveDependencyForConfig(DependencyManager.java:288) at com.android.build.gradle.internal.DependencyManager.resolveDependencies(DependencyManager.java:159) at com.android.build.gradle.internal.TaskManager.resolveDependencies(TaskManager.java:364) at com.android.build.gradle.internal.VariantManager$9.call(VariantManager.java:636) at com.android.build.gradle.internal.VariantManager$9.call(VariantManager.java:633) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120) at com.android.build.gradle.internal.profile.SpanRecorders.record(SpanRecorders.java:44) at com.android.build.gradle.internal.VariantManager.createVariantData(VariantManager.java:629) at com.android.build.gradle.internal.VariantManager.createVariantDataForProductFlavors(VariantManager.java:823) at com.android.build.gradle.internal.VariantManager.populateVariantDataList(VariantManager.java:494) at com.android.build.gradle.internal.VariantManager$1.call(VariantManager.java:269) at com.android.build.gradle.internal.VariantManager$1.call(VariantManager.java:266) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120) at com.android.build.gradle.internal.VariantManager.createAndroidTasks(VariantManager.java:265) at com.android.build.gradle.BasePlugin$11.call(BasePlugin.java:688) at com.android.build.gradle.BasePlugin$11.call(BasePlugin.java:685) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120) at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:683) at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:608) at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:605) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120) at com.android.build.gradle.BasePlugin.lambda$createTasks$1(BasePlugin.java:603) at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:93) at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:82) at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30) at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy15.afterEvaluate(Unknown Source) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:82) ... 56 more BUILD FAILED
Build.gradle of app module.
apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "au.com.company.appname" minSdkVersion 21 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } useLibrary 'org.apache.http.legacy' } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) //added library for decoding //read more functionality library compile 'com.google.maps.android:android-maps-utils:0.5' compile 'at.blogc:expandabletextview:1.0.3' compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support:design:25.3.1' compile 'com.android.support:support-v4:25.3.1' compile 'com.google.android.gms:play-services-maps:11.0.1' compile 'com.google.android.gms:play-services-location:11.0.1' compile 'com.google.android.gms:play-services-plus:11.0.1' compile 'com.google.vr:sdk-base:1.10.0' compile 'com.google.vr:sdk-common:1.10.0' compile 'com.google.vr:sdk-commonwidget:1.10.0' compile 'com.google.vr:sdk-panowidget:1.10.0' compile 'com.google.android.gms:play-services-analytics:11.0.1' compile 'com.facebook.android:facebook-android-sdk:4.15.0' testCompile 'junit:junit:4.12' }
Update 1
I followed this link Android build fails due to Proxy and created gradle.properties in $ANDROID_HOME/platforms/android-25
Now I am getting this error.
Preparing "Install SDK Patch Applier v4". Warning: An error occurred while preparing SDK package SDK Patch Applier v4: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required".: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required" at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2124) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183) at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153) at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openUrl(DownloadCache.java:245) at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openDirectUrl(DownloadCache.java:338) at com.android.sdklib.repository.legacy.LegacyDownloader.downloadFully(LegacyDownloader.java:79) at com.android.repository.impl.downloader.LocalFileAwareDownloader.downloadFully(LocalFileAwareDownloader.java:81) at com.android.repository.impl.installer.BasicInstaller.doPrepare(BasicInstaller.java:71) at com.android.repository.impl.installer.AbstractPackageOperation.prepare(AbstractPackageOperation.java:243) at com.android.builder.sdk.DefaultSdkLoader.installRemotePackages(DefaultSdkLoader.java:325) at com.android.builder.sdk.DefaultSdkLoader.updateRepositories(DefaultSdkLoader.java:458) at com.android.build.gradle.internal.DependencyManager.collectArtifacts(DependencyManager.java:550) at com.android.build.gradle.internal.DependencyManager.gatherDependencies(DependencyManager.java:385) at com.android.build.gradle.internal.DependencyManager.resolveDependencyForConfig(DependencyManager.java:288) at com.android.build.gradle.internal.DependencyManager.resolveDependencies(DependencyManager.java:159) at com.android.build.gradle.internal.TaskManager.resolveDependencies(TaskManager.java:364) at com.android.build.gradle.internal.VariantManager$9.call(VariantManager.java:636) at com.android.build.gradle.internal.VariantManager$9.call(VariantManager.java:633) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120) at com.android.build.gradle.internal.profile.SpanRecorders.record(SpanRecorders.java:44) at com.android.build.gradle.internal.VariantManager.createVariantData(VariantManager.java:629) at com.android.build.gradle.internal.VariantManager.createVariantDataForProductFlavors(VariantManager.java:823) at com.android.build.gradle.internal.VariantManager.populateVariantDataList(VariantManager.java:494) at com.android.build.gradle.internal.VariantManager$1.call(VariantManager.java:269) at com.android.build.gradle.internal.VariantManager$1.call(VariantManager.java:266) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120) at com.android.build.gradle.internal.VariantManager.createAndroidTasks(VariantManager.java:265) at com.android.build.gradle.BasePlugin$11.call(BasePlugin.java:688) at com.android.build.gradle.BasePlugin$11.call(BasePlugin.java:685) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120) at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:683) at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:608) at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:605) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120) at com.android.build.gradle.BasePlugin.lambda$createTasks$1(BasePlugin.java:603) at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:93) at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:82) at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30) at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy15.afterEvaluate(Unknown Source) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:82) at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:76) at org.gradle.configuration.project.LifecycleProjectEvaluator.access$000(LifecycleProjectEvaluator.java:33) at org.gradle.configuration.project.LifecycleProjectEvaluator$1.execute(LifecycleProjectEvaluator.java:53) at org.gradle.configuration.project.LifecycleProjectEvaluator$1.execute(LifecycleProjectEvaluator.java:50) at org.gradle.internal.Transformers$4.transform(Transformers.java:169) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50) at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:628) at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:129) at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35) at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38) at org.gradle.initialization.DefaultGradleLauncher$1.execute(DefaultGradleLauncher.java:161) at org.gradle.initialization.DefaultGradleLauncher$1.execute(DefaultGradleLauncher.java:158) at org.gradle.internal.Transformers$4.transform(Transformers.java:169) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:158) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102) at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71) at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49) at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44) at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) "Install SDK Patch Applier v4" failed. * What went wrong: A problem occurred configuring project ':app'. > Failed to install the following SDK components: [Android Support Repository, Google Repository] Please install the missing components using the SDK manager in Android Studio.
解决方案Following up from update 1 on original post,I downloaded "Android Support Repository and Google Repository" using below commands and now build is working fine.
/opt/android-sdk/tools/bin/sdkmanager --no_https --proxy=http --proxy_host=127.0.0.1 --proxy_port=3128 "extras;google;m2repository" /opt/android-sdk/tools/bin/sdkmanager --no_https --proxy=http --proxy_host=127.0.0.1 --proxy_port=3128 "extras;android;m2repository"
Although this is good for timebeing, I will be interested to hear if someone can point out how can we set proxy, so that packages will automatically get downloaded during build.
Thanks,
Vishnu这篇关于Nullpointer异常导致Android gradle编译失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!