我正在尝试使用gradle运行Android版本。只要我不缩小,它就可以正常工作。当我启用minify(minifyEnabled true)时,构建总是失败,因为“无法为proguard.gradle.ProGuardTask生成代理类”。
WARNING [Project: :phone] Support for libraries with same package name is deprecated and will be removed in 1.0
running signingConfigs
running proguard
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':phone'.
> Could not generate a proxy class for class proguard.gradle.ProGuardTask.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
gradle文件中我使用mini fy的部分:
buildTypes {
release {
println "running proguard"
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
signingConfig signingConfigs.release
}
debug {
debuggable true
}
}
只是需要一些帮助知道去哪里找...谢谢。
完整堆栈跟踪
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':phone'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:91)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:86)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:65)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:504)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:83)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:129)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java: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(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.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(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.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(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: org.gradle.api.GradleException: Could not generate a proxy class for class proguard.gradle.ProGuardTask.
at org.gradle.api.internal.AbstractClassGenerator.generateUnderLock(AbstractClassGenerator.java:204)
at org.gradle.api.internal.AbstractClassGenerator.generate(AbstractClassGenerator.java:67)
at org.gradle.api.internal.project.taskfactory.TaskFactory.createTaskObject(TaskFactory.java:116)
at org.gradle.api.internal.project.taskfactory.TaskFactory.createTask(TaskFactory.java:81)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory.createTask(AnnotationProcessingTaskFactory.java:99)
at org.gradle.api.internal.project.taskfactory.DependencyAutoWireTaskFactory.createTask(DependencyAutoWireTaskFactory.java:39)
at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:52)
at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:83)
at com.android.build.gradle.BasePlugin.createProguardTasks(BasePlugin.groovy:2776)
at com.android.build.gradle.BasePlugin$createProguardTasks$31.callCurrent(Unknown Source)
at com.android.build.gradle.BasePlugin.createPostCompilationTasks(BasePlugin.groovy:2021)
at com.android.build.gradle.internal.variant.ApplicationVariantFactory.createTasks(ApplicationVariantFactory.java:189)
at com.android.build.gradle.internal.VariantManager.createTasksForVariantData(VariantManager.java:274)
at com.android.build.gradle.internal.VariantManager.createAndroidTasks(VariantManager.java:216)
at com.android.build.gradle.internal.VariantManager$createAndroidTasks.call(Unknown Source)
at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.groovy:463)
at com.android.build.gradle.BasePlugin$_createTasks_closure9.doCall(BasePlugin.groovy:408)
at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40)
at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25)
at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)
at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy13.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:79)
... 31 more
Caused by: java.lang.NoClassDefFoundError: proguard/ParseException
at org.gradle.api.internal.AbstractClassGenerator.inspectType(AbstractClassGenerator.java:265)
at org.gradle.api.internal.AbstractClassGenerator.inspectType(AbstractClassGenerator.java:220)
at org.gradle.api.internal.AbstractClassGenerator.generateUnderLock(AbstractClassGenerator.java:98)
... 54 more
Caused by: java.lang.ClassNotFoundException: proguard.ParseException
... 57 more
如果您使用的是0.14.0或更高版本的gradle插件,则应在构建中将“runProguard”替换为“minifyEnabled”。gradle文件。
minifyEnabled false意味着构建类型名称不能是main或androidTest(这是由插件强制的),并且它们必须彼此唯一。引用错误:(26,0)未找到Gradle DSL方法:“runProguard()”
如何克服只需删除您的. gradle目录
只是需要一些帮助知道去哪里找...谢了。 全stacktrace
我在div上使用了,它可以正常工作,但是当我在其他输入上使用时,div上的停止工作。 工作代码[单击时调用附加项(项目)] 破损的代码[addItem(项目)未被调用] 相关JS代码 这里是http://plnkr.co/edit/eI5dvczO2E1Cp1SBPgQx?p=preview点击输入将带来下拉。在一种情况下,单击下拉菜单会将项目添加到选定列表中,但在其他情况下不会。 我已经试过调试
问题内容: 我正在尝试从JSON网址获取集合。骨干网确实发送了请求并得到了响应,但是在它之后的集合中没有: 这是我的JavaScript: 响应中的JSON 响应中的Content-Type HTTP标头为。 为什么不将其加载到集合中?JSON是否正确? 一些更多的代码: 问题答案: 是异步的。尝试 要么 要么
问题内容: 我有三部分字符串,每个部分用 符号分隔 。例如, 现在,当我使用这样的方法拆分它时: 它包含整个字符串作为单个元素的数组。 但是当我使用这个: 它完美的作品是什么,我想这意味着 现在的数组包含,并分别对指数0,1和2。 我想知道为什么第一次使用时不起作用,因为我在使用 问题答案: 因为字符是在正则表达式中用来标记行尾的保留令牌。因此,您必须使用进行 转义。
问题内容: 我现在有点困惑。我尝试过: 并得到: 但是,我想要: 我的代码有什么问题? 问题答案: 您没有将其分配给。字符串是 不可变的 。 您需要将其分配回。
问题内容: 我正在尝试这样做: 第一行有效: 但是接下来的两个: 和 只是输出 为什么? 问题答案: 因为你需要加入同,只是列出了内容直接,内容不具有完整路径。 范例- 如果未提供完整路径,则在当前目录中搜索,因此当您给出时,将获得正确的列表。 范例- 假设某个文件夹-具有文件-并在其中。 当您执行-时,返回的列表类似于- 即使您在其中提供绝对路径,列表中返回的文件也将具有指向目录的相对路径。您将