构建仅在发布时失败,调试构建正常.Android studio 1.4,Gradle 2.8 RC1,Gradle插件1.4.0 BETA 4
FAILURE: Build failed with an exception.
* Exception is:
org.gradle.api.GradleException: Could not determine the dependencies of task ':app:crashlyticsStoreDeobsRelease'.
...
Error:org.gradle.api.UnknownTaskException: Task with path 'dexRelease' not found in project ':app'.
Run Code Online (Sandbox Code Playgroud) 在 Junit 4 中使用Kotlin时,参数字段注入出现以下异常:
java.lang.IllegalAccessException: Class org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParameters 无法访问带有修饰符“private”的 MyTestClass 类的成员
这是代码:
@RunWith(Parameterized::class)
class MyTestClass {
@Rule
@JvmField
val mockitoRule: MockitoRule = MockitoJUnit.rule()
companion object {
@Parameters(name = "{0}")
@JvmStatic
fun testData() = listOf(
arrayOf(1, 1),
arrayOf(2, 2),
arrayOf(3, 3)
)
}
@Parameter
var input: Int = 0 // Public
@Parameter(1)
var expected: Int = 0 // Public
@Test
fun foo() {
assertEquals(expected, input)
}
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我以编程方式添加RadioButtons:
RadioButton radioButton = (RadioButton) inflater.inflate(R.layout.radio_button, null);
...
radioGroup.addView(radioButton);
Run Code Online (Sandbox Code Playgroud)
在RadioButton布局文件中,宽度为match_parent:
android:layout_width="match_parent"
android:layout_height="match_parent"
android:button="@null"
android:drawableLeft="@drawable/check_selector"
android:drawablePadding="@dimen/large"
android:paddingBottom="@dimen/large"
android:paddingTop="@dimen/large"
android:textColor="@drawable/text_selector"
Run Code Online (Sandbox Code Playgroud)
但是,将其添加到RadioGroup后,其宽度为wrap_content:“ width:-2”
Timber.e("width: %s", radioGroupReason.getChildAt(radioGroupReason.getChildCount() -1).getLayoutParams().width);
Run Code Online (Sandbox Code Playgroud)