Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/225.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
什么';Android Espresso软件包“Android.support.test.Espresso.intent”的依赖关系是什么?_Android_Testing_Android Intent_Dependencies_Android Espresso - Fatal编程技术网

什么';Android Espresso软件包“Android.support.test.Espresso.intent”的依赖关系是什么?

什么';Android Espresso软件包“Android.support.test.Espresso.intent”的依赖关系是什么?,android,testing,android-intent,dependencies,android-espresso,Android,Testing,Android Intent,Dependencies,Android Espresso,我遇到了一个有趣的包,其中特别包含用于测试意图发送的类,以及IntentMatchers类,如Intents类页面上列出的代码片段所示: Intent resultData = new Intent(); String phoneNumber = "123-345-6789"; resultData.putExtra("phone", phoneNumber); ActivityResult result = new ActivityResult(Activity.RESULT_OK, resu

我遇到了一个有趣的包,其中特别包含用于测试意图发送的类,以及IntentMatchers类,如Intents类页面上列出的代码片段所示:

Intent resultData = new Intent();
String phoneNumber = "123-345-6789";
resultData.putExtra("phone", phoneNumber);
ActivityResult result = new ActivityResult(Activity.RESULT_OK, resultData);

// Set up result stubbing when an intent sent to "contacts" is seen.
intending(toPackage("com.android.contacts")).respondWith(result));
但当我开始尝试时,安卓工作室抱怨不知道这些课程。我检查了上列出的浓缩咖啡罐(Espresso core和Espresso contrib),确实在这些罐中找不到任何
android.support.test.Espresso.intent
软件包。是否缺少任何依赖项?

您还需要

androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2'
有关更多信息,请参阅