androidx.test.ext.junit.runners报错及error running app default activity not found错误

使用工具:IDEA 2019

1,androidx.test.ext.junit.runners报错

打开这个文件:

将该文件内报错内容注释,编译,如注释后依然报错,确认有已创建成功的Activity和XML文件,将第二个问题解决方法执行一遍,编译成功且可启动IDEA内置模拟器。

2,error running app default activity not found错误

如图:

解决方法:

点击这里,选择“Nothing”

2.打开Android目录下第一个配置文件,

在你需要设置启动活动的内容中添加如下内容,

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

如我这边设置的welcome页为启动页,将这4行添加进去。

再次编译,可成功运行app,(运行之后可将之前设置的“Nothing”修改,已不会报错。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
org.junit.Test可能是由于版本不匹配的问题引起的。根据引用中提到的信息,org.junit.TestJUnit4的旧版注解,在SpringBoot2.3.X及之前的版本中使用。而在SpringBoot2.4.X及之后的版本中,采用的是JUnit5的新版注解org.junit.jupiter.api.Test。因此,如果你的项目依赖中的spring-boot-starter-test版本过低,可能会导致org.junit.Test。解决该问题的方法是更新spring-boot-starter-test的版本或者切换到使用org.junit.jupiter.api.Test注解。你可以根据引用中的提示来查看项目的spring-boot-starter-test依赖版本,并进行相应的调整。另外,还可以尝试引用中的方法,即将Junit依赖中的<scope>test</scope>删除,并刷新Maven,以解决该问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [解决java junit单元测试@Test的问题](https://download.csdn.net/download/weixin_38696339/12753989)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [SpringBoot项目中org.junit.jupiter.api.Test-溯源分析](https://blog.csdn.net/weixin_51091560/article/details/128558931)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [Test测试:org.Junit.Test不能@test测试的解决方法](https://blog.csdn.net/suhuiteng/article/details/122081835)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值