小编whi*_*arl的帖子

错误:在项目':app'上找不到属性'assembleDebug'

我正在使用'com.android.tools.build:gradle:2.2.0-alpha6'和Android Studio 2.2 Preview 6.在Gradle 2.1.0上构建运行完全正常,但为了启用即时运行,它要求我更新Gradle插件.

在更新Gradle插件时,构建显示"Error:Could not find property 'assembleDebug' on project ':app'".我已经尝试过清理.gradle.idea重新加载项目,但没有任何效果.

请帮忙.

android gradle build.gradle android-studio-2.2

25
推荐指数
2
解决办法
1万
查看次数

使用最少的插入将字符串转换为回文字符串

为了找到将给定字符串转换为回文所需的最小插入次数,我找到了字符串(lcs_string)及其反向的最长公共子序列.因此,要进行的插入次数是length(s) - length(lcs_string)

知道要插入的数量,应该采用什么方法来找到等效的回文串?

例如 :

1)azbzczdzez

所需插入次数:5 Palindrome字符串:azbzcezdzeczbza

虽然同一根弦可能存在多个回文弦但我只想找到一个回文?

algorithm dynamic-programming palindrome lcs

10
推荐指数
1
解决办法
2万
查看次数

在启用多索引的情况下,仪器测试随机失败

在我的Android应用程序中,我启用了多索引.该应用程序在模拟器上运行良好.我正在使用robotium来测试应用程序.但是当我执行检测测试用例时,有时测试会通过,但大多数情况下它们在系统重启后也会失败.通过和失败之间没有代码更改.

默认gradle配置:

android {
        defaultConfig {
        applicationId "com.example.androidapp"
        minSdkVersion 16
        targetSdkVersion 23
        multiDexEnabled true
        testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
        testProguardFile "proguard-test.txt"
    }
}
Run Code Online (Sandbox Code Playgroud)

还要为测试添加依赖项:

androidTestCompile fileTree(dir: 'libs', include:'robotium-solo-5.3.0.jar') 

androidTestCompile ('com.android.support:multidex-instrumentation:1.0.1') {
         exclude group: 'com.android.support', module: 'multidex' }
Run Code Online (Sandbox Code Playgroud)

在AndroidManifest.xml中,我提到了应用程序标记:

<application
        android:name="StartupActivity"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name" ...../>
Run Code Online (Sandbox Code Playgroud)

我在StartupActivity中扩展了"android.support.multidex.MultiDexApplication".仪器测试用例下降的时间我得到以下错误:

INSTRUMENTATION_RESULT: shortMsg=java.lang.IllegalAccessError
INSTRUMENTATION_RESULT: longMsg=java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
INSTRUMENTATION_CODE: 0
Run Code Online (Sandbox Code Playgroud)

logcat中的错误消息是:

W/dalvikvm? Class resolved by unexpected DEX: Lcom/example/androidapp/StartupActivity;(0xa695df08):0x9910e000 ref [Landroid/support/multidex/MultiDexApplication;] Landroid/support/multidex/MultiDexApplication;(0xa695df08):0x99a2c000
W/dalvikvm? (Lcom/example/androidapp/StartupActivity; had used a different Landroid/support/multidex/MultiDexApplication; during pre-verification)
W/dalvikvm? Unable to …
Run Code Online (Sandbox Code Playgroud)

android gradle robotium android-instrumentation android-multidex

6
推荐指数
1
解决办法
1233
查看次数