2
버튼을 클릭 할 때 UIAutomator를 실행하는 응용 프로그램을 만들려고합니다. 현재 런타임 문제는 UiAutomator의 NoclassDefFound입니다. 빌드 경로 내에 이미 uiautomator jar가 추가되었습니다. 문제를 해결할 수있는 포인터는 무엇입니까? 감사!apk 안에 UIAutomator를 번들하는 방법
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button clickMe = (Button) findViewById(R.id.button1);
clickMe.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Log.i("Hello", "Prior to clicking");
UiObject clickBtn = new UiObject(new UiSelector().description("Apps"));
try {
clickBtn.click();
} catch (UiObjectNotFoundException e) {
Log.i("Hello", "Error is catched");
}
Log.i("Hello", "Button is clicked");
}
});