AS运行main()方法报错:SourceSet with name ‘main‘ not found

技术标签: Android Studio工具  Android开发  android  AS

AS运行main()方法报错:SourceSet with name ‘main’ not found 记录一下在AS上运行Java文件的main()方法时报错,报错如下: 解决方法:在.idea文件夹下的gradle.xml文件中添加<option name="delegatedBuild" value="false" /&g...

android studio中运行java.main报错解决

安卓平台下,用android平台去测试代码模块还是很麻烦,启动慢,很多模块测试不需要UI,所以想搞一下java直接测试,但是遇到运行不了报错报错就是找不到这个main,错误原因是工程配置上面,进入.idea文件夹修改gradle.xml文件即可: 修改方式如下,就是添加条配置: 字面意思就是把委托build设置为false,应该就是javamain启动不通过gradle委托来

The SourceSet 'instrumentTest' is not recognized by the Android Gradle Plugin. Perhaps you misspelle

studio3.1被弃用了,不适用于AS3.1gradle了。 那如何解决这个问题呢? 把instrumentTest换成androidTest,重新编译即可。 如果本文对您有所帮助,麻烦点击一下左侧点赞按钮...Android studio升级到3.1后,原来运行得好好项目都报错了,报错内容如下: The SourceSet 'instrumentTest' is not recognized by

【androidstudio】The SourceSet ‘instrumentTest‘ is not recognized by the Android Gradle Plugin

问题描述 The SourceSet &lsquo;instrumentTest&rsquo; is not recognized by the Android Gradle Plugin. Perhaps you misspelled something? AndroidStudio升级到4.0.1后编译报错:The SourceSet &lsquo;instrumentTest&rsquo

Groovy/Gradle:

settings.gradle文件中去初始化,所以可以settings.gradle调用Settings类方法 其中include()方法就可以将我们新建子工程引入进来,引入进来以后,gradle才会将其当成是个工程去处理。 SourceSet类 为什么gradle会知道从src/main/java去读取源码? 这就是从SourceSet配置中去拿到。 其决定了我们所有代码、资源

netty-grpc_gradle代码生成位置

/grpc。 位置组成 生成代码位置默认$generatedFilesBaseDir/$sourceSet/$builtinPluginName下面。 先分割一下前面默认位置...够直接把代码生成到工程当中。 generatedFilesBaseDir 我protobuf配置添加了这句(其他配置保留),clean之后generateProto,如下 根目录已经


智能推荐

DX例子运行时,出现错误‘main‘: entrypoint not found

在没有添加hlsl文件的时候是可以正常运行的,一旦添加之后,就会出现'main': entrypoint not found错误,经过查阅之后,发现需要修改配置属性: 右键hlsl文件,“属性->配置属性->常规->项类型”,将“HLSL编译器”改为“不参与生成”,就可以正常运行了...

ImportError: cannot import name 'main'

首先说明一下,遇到这种问题的一般都是Ubuntu系统升级完pip之后会出现这种问题。总结一下网上的解决方案有如下几个: (1)使用如下的命令: (2)stackoverflow上的第二个解决方法: 但是我的是Windows系统,不知道怎么回事突然就崩了,出现了这个问题!!! 方法类似于Ubuntu系统的方法,略微有点不同。步骤如下: (1)在命令行下输入 where pip命令,找到pip所在的位...

if __name__ == "__main__"

__name__是python 的一个内置属性,而__main__就是字符串”__mian__” 这俩东西的好处:让模块中的测试代码顺利测试,而不会被其他导入文件执行 说明:__main__就是一个字符串   导入模块后,效果如下:        ...

if __name__ == ‘__main__‘

if __name__ == '__main__'  __name__ 是当前模块名,当模块被直接运行时,模块名为 __main__ 。 这句话的意思就是,当模块被直接运行时,以下代码块将被运行,当模块是被导入时,代码块不被运行。     可以看到 const.py里面的main()也被执行了,但这是我们所不希望的 _name_代表当前模块的名字,当我们再次运行&ld...

if __ name __ == ‘__ main __‘的作用

if __ name __ == '__ main __'的作用 一个python文件的执行一般有两种情况: 第一种是作为脚本直接执行 第二种是作为被import后到其他的脚本中本执行 而在应用了if name == main后,在if name == main 后面的代码是只有在第一种情况下才会被执行,而如果被import到其他的脚本中是不会被执行的 if __ name __ == __ ma...

猜你喜欢

__name__与__main__

__ name __ = ‘__ main__’ 被调用模块存在的意义:调用我想要的那部分 此函数用意在于当一个模块被调用时,如此模块不作为主程序(程序员手动去执行的模块)去运行,而是被调用时,不属于函数的部分或是类的部分的代码将会主动执行。 此时我们需要用__name__ = ‘__ main__’ , __ name__说的是被调用的模块名,意思...

简易白嫖mathpix操作

因为免费用户每月只有50次 所以我们充分利用每一次,于是我们把需要截图的公式,先截图排列到一张画布上 之后一次识别多个公式即可 (Windows端可以用QQ截图悬挂,Linux/Mac/Windows都可以下载Snippet 来悬挂截图)...

TypeError: require.context is not a function [解决文案]

const files = require.context(path.join(’…/…/’, ‘src/views’), true, /.htmlKaTeX parse error: Can't use function '\.' in math mode at position 404: …iews'),...

实例! 领域驱动四色建模法分析需求

博客文章地址: https://www.lixiang.red/articles/2020/03/11/1583932666537.html 领域驱动和微服务的关系 自从微服务火了之后,如何去划定微服务的界限成了团队一直讨论不休的问题. 界限大了,一个库里面十几张表,又变成了以前的单体应用,界限小了, 一个微服务里面就一个方法, 然后还要用一个Jvm去跑 这时候,我们就可以用领域驱动来解决微服务界...

vc++工程中添加lua代码调用-增加lua的源码到工程

步骤如下: 一。安装vs2012或者vs2013 二。下载lua源代码,这里下载的是5.3.4版本,目录结构如下图: 三。src目录是我们需要的代码,将里面的lua.c和luac.c删除,这两个文件定义了一个入口函数,而在vs里面已经有了入口函数。 四。在vs里创建一个工程,选择consolewin程序,方便输出,这里不能选择预编译头文件,否则会报错,如下提示: 错误   &n...

问答精选

Refreshing parent fragment on PopupWindow.dismiss

I have a popupWindow that modifies a SQLight table that loads a spinner in the parent window. I would like to have the spinner in the parent window refreshed with the new values when I dismiss the Pop...

Styling a jQuery Plug-In (ClassyCountdown)

I am using the Countdown from this site: http://www.class.pm/files/jquery/classycountdown/ Now I want to style the Countdown, but I don´t know how. I want to edit the font, the color, the thickn...

Decimal Regex Constraint Matching (Four digits before optional decimal point and two after)

I need to figure out how to make my regex allow match correctly each time I type a number/decimal point. I want to limit the number of digits before and after the decimal point, which isnt too hard bu...

Subtracting min and max values from ListBox to find range

I can't seem to subtract the max from the min does anyone know how I can fix this. Code: That doesn't look like very good code besides but I think that this: should be this: This is a scenario that is...

Trap SIGINT in Cocoa macos application

I am attempting to trap a SIGINT for a UI application made for MacOS. In the app delegate class, I see the following method: However, a Ctrl + C, SIGINT, never gets caught in here. Reading around the ...

相关问题

相关文章

热门文章

推荐文章

相关标签

推荐问答