我无法从Android工作室运行应用程序到运行android 2.3.6的samsumg手机.我正在获取应用程序安装失败的弹出窗口参见下面的截图.

当我点击OK我在日志中得到以下错误
Failure [INSTALL_FAILED_DEXOPT]
DEVICE SHELL COMMAND: pm uninstall my.package.name
Unknown failure
Run Code Online (Sandbox Code Playgroud)
在添加名为"带有Google Cloud Messaging的App Engine后端"的Google云端模块后,我遇到了麻烦.
这与此处的堆栈溢出问题中描述的问题完全相同
我尝试了接受的答案.
Ran dex-method-counts应用程序我在终端获得了"总方法计数:24474".我不明白接下来该做什么?
(注意:在kitkat上运行的其他设备上运行相同的应用程序.)
请帮助解决此问题.我过去两天都在苦苦挣扎.我知道有很多类似的问题,但没有任何帮助我.
内置 - >清洁不起作用.
这是我的build.gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "my.package.name"
minSdkVersion 9
targetSdkVersion 19
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile files('libs/libGoogleAnalyticsServices.jar')
compile project(path: ':gcmAppEngineBackend', configuration: 'android-endpoints')
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:appcompat-v7:22.0.0' …Run Code Online (Sandbox Code Playgroud) failed-installation android-2.3-gingerbread dexopt android-studio
我正在写Espresso Test.这是测试用例
点击Fab,该应用程序启动QuizActivity.
让我向你解释我的应用程序.
所以应用程序的要求是 -
这是我编码的方式 -
以下是我的测试
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
/* @Rule
public IntentsTestRule<MainActivity> intentsTestRule =
new IntentsTestRule<MainActivity>(MainActivity.class);
*/
@Rule
public ActivityTestRule<MainActivity> intentsTestRule =
new ActivityTestRule<MainActivity>(MainActivity.class,false,true);
@Test
public void fabTest(){
onView(withId(R.id.fab)).perform(click());
//Check if the text_question textview is displayed
onView(withId(R.id.text_question)).check(matches(isDisplayed()));
}
/* @Test
public void clickFloatingActionButton() {
onView(withId(R.id.fab))
.perform(click());
intended(hasComponent(new ComponentName(getTargetContext(), QuizActivity.class)));
}*/
}
Run Code Online (Sandbox Code Playgroud)
我的方法是 -
在我运行测试后,我得到了
java.lang.RuntimeException:无法在45秒内启动意图Intent {act = android.intent.action.MAIN flg = 0x14000000 cmp = my_package_name/.MainActivity}.也许主线程在合理的时间内没有闲置?可能会有一个动画或不断重新绘制屏幕的东西.或者活动是在创建网络呼叫?请参阅threaddump日志.在您的活动启动请求为1505287862579之前,上次事件队列空闲的时间供您参考,现在队列最后一次空闲时间是:1505287862579.如果这些数字相同,您的活动可能会占用事件队列. …