Android studio 出现错误Run with --stacktrace option to get the stack trace. Run with --info or --debu

 Android studio Run with --stacktrace option to get the stack trace. Run with --info or --debu

提示信息

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

其实是让你去查看更多的log信息。找到你项目的根目录,比如你的项目是MyApplication,在dos命令下进入该目录执行

gradlew compileDebug --stacktrace 

如果上面的命令不管用,可以使用下面的命令试试

gradle compileDebug --stacktrace 

可以看到很多错误的信息输出出来。


E:\MyApplication>gradle compileDebug --stacktrace 

FAILURE: Build failed with an exception. 

* What went wrong:
A problem occurred configuring root project 'MyApplication'.
> Could not resolve all dependencies for configuration ':classpath'.
  > Could not resolve com.android.tools.build:gradle:1.0.0.
   Required by:
     :MyApplication:unspecified
   > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradl
e/1.0.0/gradle-1.0.0.pom'.
     > Connection to https://jcenter.bintray.com refused 

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

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring roo
t project 'MyApplication'.
    at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigu
rationFailure(LifecycleProjectEvaluator.java:91)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L
ifecycleProjectEvaluator.java:61)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj
ect.java:504)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj
ect.java:83)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(Task
PathProjectEvaluator.java:42)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil
dConfigurer.java:35)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default
GradleLauncher.java:129)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle
Launcher.java:106)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun
cher.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon
troller.run(InProcessBuildActionExecuter.java:80)
    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:36)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
ssBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.jav
a:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
execute(CommandLineActionFactory.java:237)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
execute(CommandLineActionFactory.java:210)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti
meValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti
meValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
CommandLineActionFactory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
CommandLineActionFactory.java:169)
    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:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots
trap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j
ava:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all depe
ndencies for configuration ':classpath'.
    at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfigurat
ion.rethrowFailure(DefaultLenientConfiguration.java:52)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultResolvedConfigura
tion.rethrowFailure(DefaultResolvedConfiguration.java:36)
    at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyR
esolver$FilesAggregatingResolvedConfiguration.rethrowFailure(SelfResolvingDepend
encyResolver.java:110)
    at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDep
endencyResolver$ErrorHandlingResolvedConfiguration.rethrowFailure(ErrorHandlingA
rtifactDependencyResolver.java:180)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:444)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
.getFiles(DefaultConfiguration.java:205)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
_Decorated.getFiles(Unknown Source)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.defineS
criptHandlerClassScope(DefaultPluginRequestApplicator.java:142)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPl
ugins(DefaultPluginRequestApplicator.java:60)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.
apply(DefaultScriptPluginFactory.java:131)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc
riptProcessor.java:39)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc
riptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.eva
luate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L
ifecycleProjectEvaluator.java:59)
    ... 27 more
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not
resolve com.android.tools.build:gradle:1.0.0.
Required by:
  :MyApplication:unspecified
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryCha
inDependencyResolver.resolve(RepositoryChainDependencyResolver.java:81)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryCha
inAdapter.resolve(RepositoryChainAdapter.java:69)
    at org.gradle.api.internal.artifacts.ivyservice.clientmodule.ClientModul
eResolver.resolve(ClientModuleResolver.java:44)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.Depe
ndencyGraphBuilder$ModuleVersionResolveState.resolve(DependencyGraphBuilder.java
:577)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.Depe
ndencyGraphBuilder$ModuleVersionResolveState.getMetaData(DependencyGraphBuilder.
java:587)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.Depe
ndencyGraphBuilder$DependencyEdge.calculateTargetConfigurations(DependencyGraphB
uilder.java:272)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.Depe
ndencyGraphBuilder$DependencyEdge.attachToTargetConfigurations(DependencyGraphBu
ilder.java:246)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.Depe
ndencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:156)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.Depe
ndencyGraphBuilder.resolveDependencyGraph(DependencyGraphBuilder.java:94)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.Depe
ndencyGraphBuilder.resolve(DependencyGraphBuilder.java:84)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDep
endencyResolver$1.execute(DefaultDependencyResolver.java:122)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDep
endencyResolver$1.execute(DefaultDependencyResolver.java:88)
    at org.gradle.internal.Transformers$4.transform(Transformers.java:136)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager
.withIvy(DefaultIvyContextManager.java:61)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager
.withIvy(DefaultIvyContextManager.java:39)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDep
endencyResolver.resolve(DefaultDependencyResolver.java:88)
    at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDepe
ndencyResolver$1.run(CacheLockingArtifactDependencyResolver.java:42)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc
ess.java:187)
    at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc
ess.java:175)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(De
faultPersistentDirectoryStore.java:106)
    at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.
useCache(DefaultCacheFactory.java:187)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManag
er.useCache(DefaultCacheLockingManager.java:64)
    at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDepe
ndencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:40)
    at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyR
esolver.resolve(SelfResolvingDependencyResolver.java:45)
    at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigs
ArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyRes
olver.java:55)
    at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDep
endencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:47)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationReso
lver.resolve(DefaultConfigurationResolver.java:46)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
.resolveNow(DefaultConfiguration.java:250)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
.getResolvedConfiguration(DefaultConfiguration.java:240)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
_Decorated.getResolvedConfiguration(Unknown Source)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:442)
    ... 36 more
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Cou
ld not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.0.0/gra
dle-1.0.0.pom'.
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performR
equest(HttpClientHelper.java:80)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performR
awGet(HttpClientHelper.java:66)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performG
et(HttpClientHelper.java:70)
    at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getR
esource(HttpResourceAccessor.java:53)
    at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getR
esource(HttpResourceAccessor.java:36)
    at org.gradle.internal.resource.transfer.ProgressLoggingExternalResource
Accessor.getResource(ProgressLoggingExternalResourceAccessor.java:39)
    at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResour
ceAccessor.getResource(DefaultCacheAwareExternalResourceAccessor.java:72)
    at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExtern
alResourceArtifactResolver.downloadStaticResource(DefaultExternalResourceArtifac
tResolver.java:91)
    at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExtern
alResourceArtifactResolver.resolveMetaDataArtifact(DefaultExternalResourceArtifa
ctResolver.java:57)
    at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResou
rceResolver.parseMetaDataFromArtifact(ExternalResourceResolver.java:162)
    at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResou
rceResolver.resolveStaticDependency(ExternalResourceResolver.java:141)
    at org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver
.doResolveComponentMetaData(MavenResolver.java:82)
    at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResou
rceResolver$RemoteRepositoryAccess.resolveComponentMetaData(ExternalResourceReso
lver.java:391)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CacheLockRele
asingModuleComponentsRepository$LockReleasingRepositoryAccess$2.run(CacheLockRel
easingModuleComponentsRepository.java:65)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(Def
aultCacheAccess.java:237)
    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(Def
aultCacheAccess.java:308)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunning
Operation(DefaultPersistentDirectoryStore.java:114)
    at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.
longRunningOperation(DefaultCacheFactory.java:179)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManag
er.longRunningOperation(DefaultCacheLockingManager.java:56)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CacheLockRele
asingModuleComponentsRepository$LockReleasingRepositoryAccess.resolveComponentMe
taData(CacheLockReleasingModuleComponentsRepository.java:63)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModule
ComponentRepository$ResolveAndCacheRepositoryAccess.resolveComponentMetaData(Cac
hingModuleComponentRepository.java:284)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.BaseModuleCom
ponentRepositoryAccess.resolveComponentMetaData(BaseModuleComponentRepositoryAcc
ess.java:38)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMe
moryCachedModuleComponentRepository$CachedAccess.resolveComponentMetaData(InMemo
ryCachedModuleComponentRepository.java:70)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ComponentMeta
DataResolveState.process(ComponentMetaDataResolveState.java:70)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ComponentMeta
DataResolveState.resolve(ComponentMetaDataResolveState.java:62)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryCha
inDependencyResolver.findBestMatch(RepositoryChainDependencyResolver.java:114)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryCha
inDependencyResolver.findBestMatch(RepositoryChainDependencyResolver.java:97)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryCha
inDependencyResolver.resolve(RepositoryChainDependencyResolver.java:70)
    ... 67 more
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to https://
jcenter.bintray.com refused
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnect
ion(DefaultClientConnectionOperator.java:190)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedCli
entConnectionImpl.java:294)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(Default
RequestDirector.java:640)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultReq
uestDirector.java:479)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpCl
ient.java:906)
    at org.apache.http.impl.client.DecompressingHttpClient.execute(Decompres
singHttpClient.java:137)
    at org.apache.http.impl.client.DecompressingHttpClient.execute(Decompres
singHttpClient.java:118)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performH
ttpRequest(HttpClientHelper.java:111)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.executeG
etOrHead(HttpClientHelper.java:87)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performR
equest(HttpClientHelper.java:78)
    ... 95 more
Caused by: java.net.ConnectException: Connection timed out: connect
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFact
ory.java:549)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnect
ion(DefaultClientConnectionOperator.java:180)
    ... 104 more 

BUILD FAILED 

Total time: 45.485 secs

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

(0)

相关推荐

  • 简单谈谈android studio 的单元测试

    面对android studio Run 一次项目要等好几分钟的痛点,不得不研究一下android studio 的单元测试. 其实我的目的很简单,在不对视图进行操作的前提下,测试一些activity 的生命周期,或网络拉取数据的一些处理,比如解析 json 数据啊,做网络请求啊等等,也就是对 Model层的测试.这些不需要操作视图,但在没有单元测试环境下,比如我们网络请求一些数据,Log 打印看看是否请求成功,却又要 利用模拟器或真机Run 一次项目,花费好几分钟,这是不能容忍的. 于是乎,强

  • 关于AndroidStudio R文件莫名其妙缺失的快速解决方法

    今天Android Studio提示我这个东东... 为了加快Gradle的构建速度,我点击了"Update"... 之后工程一片红,全是R文件缺失 正常情况下,R文件缺失时,我们只需要使用 Build -> Clean Project 和 Build -> Rebuild Project 重构下工程就可以了,但是我反复重构都没有用 这就纳闷了,折腾了半天后,在Messages中发现了这个error: 错误信息: Error:Execution failed for tas

  • Ubuntu16.04 LTS 下安装 Android Studio 2.2.2 的详细步骤

    下载 Android SDK,官网:www.android.com我相信很多人跟我一样,进不去.Android Studio 中文官网 www.android-studio.org 进去下载, 在终端解压到想安装SDK的目录(设SDK目录为 $ASDK_HOME )即安装完成. 进入目录 $ASDK_HOME/tools/,终端运行命令 ./android 进入 SDK Manager. 通过这个软件,可以选择下载相关的开发包,有不同版本的 SDK 及其源码文档等,注意:必须下载 Extras

  • Android studio中生成引用.aar和.jar的方法详解

    在Android Studio中对一个自己库进行生成操作时将会同时生成*.jar与*.aar文件. 分别存储位置: *.jar:库 /build/intermediates/bundles/debug(release)/classes.jar *.aar:库 /build/outputs/aar/libraryname.aar .jar 与 .aar的区别 从名称上来讲,一个是java application resource:一个是android application resource: 那

  • AndroidStudio 使用过程中出现的异常(Gradle sync failed)处理办法

    AndroidStudio使用过程中出现的异常 异常信息: Gradle sync failed: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on th

  • 解决Android Studio导入项目非常慢的办法

    前言 大家都知道Android Studio目前已经更新到2.0 Preview 6了,作为Google大力推崇的开发工具,相对于Eclipse ADT有着不可比拟的优势.然而在实际使用时,依然有不少不爽的地方.Android Studio原生支持使用Gradle来构建项目本是个不错的想法,使用动态语言Groovy定义项目构建过程,避免了build.xml文件的繁琐定义.但是Gradle的二进制包体积较大,而且用户可能按照了不同的Gradle版本,构建时可能会出现各种问题.因此又提出了Gradl

  • Android sdutio配置Zxing进行扫码功能的实现方法

    github开源项目(Zxing)demo 最快的调用Zxing方法 1.关联第三方库 2.调用基础的扫码 3.获取返回值 具体代码如下: //1.默认选项启动意图 new IntentIntegrator(MainActivity.this).initiateScan(); // `this` is the current Activity //2.获取得到的结果: @Override protected void onActivityResult(int requestCode, int r

  • Android Studio Intent隐式启动,发短信,拨号,打电话,访问网页等实例代码

    Android Studio Intent隐式启动,发短信,拨号,打电话,访问网页等实例代码 功能 创建5个按钮,隐式启动.发短信.拨号按钮.电话按钮.打开网页按钮.通过使用Intent来完成各自按钮下的功能 代码目录如下 详细代码如下: activity_main.xml代码如下 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://sc

  • Android studio 出现 Unsupported major.minor version 52.0解决办法

    Android studio 出现 Unsupported major.minor version 52.0解决办法 最近更新了Android studio 之后,出现了Error:Java.lang.UnsupportedClassVersionError:com/android/dx/command/Main : Unsupported major.minor version 52.0 异常, 一.这是因为 compileSdKVersion 和 buildToosVersion 版本对不上

  • Android studio 出现错误Run with --stacktrace option to get the stack trace. Run with --info or --debu

     Android studio Run with --stacktrace option to get the stack trace. Run with --info or --debu 提示信息 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 其实是让你去查看更多的log信息.找到你项目的根目录,比如你的项目是MyApp

  • Android Studio无法执行Java类的main方法问题及解决方法

    Android Studio升级到哦最新版3.6.1后,新建了个项目,发现无法执行Java类的main方法.试了网上的各种方法,比如切换gradle离线模式.gradle.properties中添加android.enableAapt2=false等,我还尝试了重新情况Gradle缓存.重新下载gradle等方式,都没用. 环境 android studio版本:3.6.1 gradle版本:5.6.4 gradle插件版本:3.6.1 错误提示 11:41:35 PM: Executing t

  • Flutter下Android Studio配置gradle的方法

    一.失败的经历:手动配置gradle 下载gradle包http://gradle.org/gradle-download/ Mac Finder->Applications/应用程序->Android Studio右键显示包内容.继续打开Contents文件夹,正常情况下会有一个gradle文件夹,将下载解压之后的文件复制到这个文件夹下.如果Contents文件夹下没有gradle文件夹,创建gradle文件夹,继续后面的操作 配置gradle环境路径 打开终端,打开系统环境配置文件vim

  • Android Studio多渠道打包套路

    说到多渠道,这里不得不提一下友盟统计,友盟统计是大家日常开发中常用的渠道统计工具,而我们的打包方法就是基于友盟统计实施的.按照友盟官方文档说明,渠道信息通常需要在AndroidManifest.xml中配置如下值: <meta-data android:value="Channel ID" android:name="UMENG_CHANNEL"/> 上面的value值Channel_ID就是渠道标识.我们的期望的就是在编译时候这个值能够自动变化以满足区

  • 解决Android studio Error:(30, 31) 错误: 程序包 不存在的问题

    一.修复bug 记录这个bug,不是说这个问题有多么难,而是在解决之前,尝试了很多办法,它是一个不断试错的过程,比如: 多次的 clean project/ rebuild project: 查看主项目下的build/ 查看编译之后的.class 文件,发现并不存在library 的编译代码: 尝试了将library 的包名重新命名.先删除,然后添加进来: 试了很多办法,当然都没有用,最后搜索才发现是和混淆有关,于是将library 的混淆关闭,再编译就ok ,如下: buildTypes {

  • Android studio报: java.lang.ExceptionInInitializerError 错误

    一.问题描述 Android studio导入一个项目报一堆错误: Process: xhs.com.xhswelcomeanim, PID: 1416 Java.lang.ExceptionInInitializerError at com.werb.gankwithzhihu.ui.fragment.ZhihuFragment.createPresenter(ZhihuFragment.java:33) at com.werb.gankwithzhihu.ui.fragment.ZhihuF

  • Android Studio中Run按钮是灰色的快速解决方法

    首先是,在不同的AS中,gradle版本不同,下载的sdk版本不同,这些,都在gradle(Project.Models)相关代码里调过来就好.之前的文章里有说过. 经过调好gradle这些文件,AS已经可以built 成功后. 下一步,Run the application. 这时候,遇到问题:Run按钮灰色,失效. 点击Run旁边 Select Run/Debug Configuration按钮 选择 Edit Configuration,于是: 在model下拉框中选择app.如果下拉框中

  • Android Studio升级4.1.1后各种错误和解决方案

    1,CMake Error: CMake was unable to find a build program corresponding to "Ninja". 因为项目中使用到Cmake编译的C/C++代码,升级了Android Studio后编译出现CMake Error: CMake was unable to find a build program corresponding to "Ninja".CMAKE_MAKE_PROGRAM is not se

  • android studio更新gradle错误构建项目失败的解决方法

    一.版本错误 对应版本,修改gradle version,和plusing version两个地方修改gradle version,和plusing version的方法有两种,一种是在 project.build.这里plusing version的设置 buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.0' } } allprojects

  • android studio错误: 常量字符串过长的解决方式

    android studio 错误: 常量字符串过长错误 省市区三级联动,位置字符串. 这样不行 改用json方案 ,读取array中文件 String provsData = new GetJsonDataUtil().getJson(activity, "provsData.json");//获取assets目录下的json文件数据 String distsData = new GetJsonDataUtil().getJson(activity, "distsData.

随机推荐