gpt4 book ai didi

android - ActivityTestRule 在 android 测试中被弃用

转载 作者:行者123 更新时间:2023-12-04 23:49:04 67 4
gpt4 key购买 nike

这是我的仪器测试的范围:

...
import androidx.test.rule.ActivityTestRule

@RunWith(AndroidJUnit4::class)
@LargeTest
class InstrumentDialogFragmentTest {

@get:Rule
val activityRule = ActivityTestRule(MainActivity::class.java)
}
我的毕业典礼:
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test:rules:1.4.0'
我收到这个警告:
'ActivityTestRule<T : Activity!>' is deprecated. Deprecated in Java

最佳答案

你仍然可以在 'androidx.test:rules:1.2.0' 上使用它。
它在 1.4.0 上已弃用。
请改用 ActivityScenario 或 ActivityScenarioRule。
查看更多:enter link description here

关于android - ActivityTestRule 在 android 测试中被弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69616702/

67 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com