安卓studio打包错误Lint found fatal errors while assembling a release target.

今天把一个老项目从eclipse转移到android studio中再打包出现了这个错误
在这里插入图片描述

按照提示我们在
我们在 app的build android{}中添加

lintOptions {
checkReleaseBuilds false
abortOnError false
}

这样就可以正常打包了

还有一种错误 org.gradle.internal.exceptions.LocationAwareException: Execution failed for task

这个需要在项目的build里两个repositories中加入 然后重新编译过后重新运行就好了

 mavenCentral()
 
 jcenter{url "http://jcenter.bintray.com/"}
发布了47 篇原创文章 · 获赞 65 · 访问量 1万+
展开阅读全文

android studio编译项目时遇到这个问题。

06-27

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.google.wireless.android.sdk.stats.AndroidStudioStats$GradleBuildProfile at com.android.builder.profile.ProcessRecorder.<init>(ProcessRecorder.java:96) at com.android.builder.profile.ProcessRecorderFactory.get(ProcessRecorderFactory.java:222) at com.android.builder.profile.ProcessRecorderFactory.initialize(ProcessRecorderFactory.java:122) at com.android.build.gradle.internal.profile.ProfilerInitializer.init(ProfilerInitializer.java:66) at com.android.build.gradle.BasePlugin.apply(BasePlugin.java:310) at com.android.build.gradle.LibraryPlugin.apply(LibraryPlugin.java:85) at com.android.build.gradle.LibraryPlugin.apply(LibraryPlugin.java:40) at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(ImperativeOnlyPluginApplicator.java:35) at org.gradle.api.internal.plugins.RuleBasedPluginApplicator.applyImperative(RuleBasedPluginApplicator.java:43) at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:139) at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:112) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyType(DefaultObjectConfigurationAction.java:113) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:36) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:80) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:136) at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:44) at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.java:34) at org.gradle.api.Script$apply$0.callCurrent(Unknown Source) at build_1ztzbib3h4rketyrpodndoubp.run(F:\yjyl_android_studio_work_space\teacher_svn\pIMlibs\build.gradle:1) at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:90) 问答

Android studio build时候报错

01-26

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.5.0. Required by: :MyApplication:unspecified > Could not resolve com.android.tools.build:gradle:1.5.0. > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.5.0/gradle-1.5.0.pom'. > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.5.0/gradle-1.5.0.pom'. > Connection to https://jcenter.bintray.com refused * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 45.925 secs Process finished with exit code 1 本地是有gradle的,但是好像build的时候还需要去下载似的 这个是运行出来的gradlew compileDebug --stacktrace 出来的Log信息,求指教 D:\work\Androidstudio\project\MyApplication>gradlew compileDebug --stacktrace Downloading https://services.gradle.org/distributions/gradle-2.8-all.zip Exception in thread "main" java.net.UnknownHostException: services.gradle.org at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:649) at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:275) at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1103) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:997) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1511) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) at org.gradle.wrapper.Download.downloadInternal(Download.java:58) at org.gradle.wrapper.Download.download(Download.java:44) at org.gradle.wrapper.Install$1.call(Install.java:61) at org.gradle.wrapper.Install$1.call(Install.java:48) at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) at org.gradle.wrapper.Install.createDist(Install.java:48) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览