This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.NoSuchMethodError: com.google.android.material.shape.MaterialShapeDrawable.<init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V | |
at com.google.android.material.dialog.MaterialAlertDialogBuilder.<init>(MaterialAlertDialogBuilder.java:121) | |
at com.google.android.material.dialog.MaterialAlertDialogBuilder.<init>(MaterialAlertDialogBuilder.java:103) | |
at our.code.onCreate(OurFragment.kt:112) | |
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2684) | |
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:280) | |
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1175) | |
at androidx.fragment.app.FragmentTransition.addToFirstInLastOut(FragmentTransition.java:1255) | |
at androidx.fragment.app.FragmentTransition.calculateFragments(FragmentTransition.java:1138) | |
at androidx.fragment.app.FragmentTransition.startTransitions(FragmentTransition.java:136) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This file configures the static code analysis done by Detekt (https://arturbosch.github.io/detekt/index.html) | |
# | |
# Derivations from the defaults (https://github.com/arturbosch/detekt/blob/master/detekt-cli/src/main/resources/default-detekt-config.yml) | |
# are not listed here, unless we specifically voted on a rule to be used / not used. | |
# | |
# If adaptions to a default rule are made, the _complete_ configuration of that rule should be included here, not | |
# only the part that is actually overridden. This is important to see the rule in context. | |
# | |
# If you want to introduce changes to existing rules and / or want to introduce new rules, please use the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val singleParamUseCase = ... | |
// single execution (param is stubbed as "any()") | |
singleParamUseCase.stubObserver { | |
onSuccess("yay") | |
} | |
viewModel.triggerSomething() | |
singleParamUseCase.execute("some-param") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <T : Fragment> FragmentActivity.getOrAddFragment(tag: String, commitNow: Boolean = true, initFun: () -> T): T = | |
supportFragmentManager.findFragmentByTag(tag) as? T ?: run { | |
initFun().also { | |
addFragment(supportFragmentManager, tag, commitNow, it) | |
} | |
} | |
fun <T : Fragment> Fragment.getOrAddFragment(tag: String, commitNow: Boolean = true, initFun: () -> T): T = | |
childFragmentManager.findFragmentByTag(tag) as? T ?: run { | |
initFun().also { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android.applicationVariants.all { variant -> | |
configurations.create("${variant.name}IntegrationTestImplementation") { | |
extendsFrom configurations.find { it.name == "implementation" } | |
extendsFrom configurations.find { it.name == "${variant.name}Implementation" } | |
} | |
def sourceSet = android.sourceSets.create("${variant.name}IntegrationTest") { | |
// this fails here because `compileClasspath` is not existant in `AndroidSourceSet` | |
compileClasspath += variant.javaCompile.classpath | |
runtimeClasspath += variant.javaCompile.classpath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task resolveDependencies { | |
description "Resolves dependencies for all build variants of this Android module" | |
doLast { | |
project.buildscript.configurations.findAll { it.canBeResolved }.each { it.resolve() } | |
} | |
} | |
def factory = project.getObjects() | |
if (project.plugins.hasPlugin('com.android.application')) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.auto.service.AutoService | |
import org.robolectric.internal.dependency.DependencyResolver | |
import org.robolectric.pluginapi.SdkProvider | |
import org.apache.maven.artifact.ant.DependenciesTask | |
import org.robolectric.internal.dependency.DependencyJar | |
import java.io.IOException | |
import java.nio.channels.FileLock | |
import java.nio.channels.FileChannel | |
import java.io.RandomAccessFile | |
import java.io.File |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CoverageListener E Failed to generate Emma/JaCoCo coverage. | |
E java.lang.reflect.InvocationTargetException | |
E at java.lang.reflect.Method.invoke(Native Method) | |
E at androidx.test.internal.runner.listener.CoverageListener.generateCoverageReport(CoverageListener.java:101) | |
E at androidx.test.internal.runner.listener.CoverageListener.instrumentationRunFinished(CoverageListener.java:70) | |
E at androidx.test.internal.runner.TestExecutor.reportRunEnded(TestExecutor.java:92) | |
E at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:65) | |
E at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:388) | |
E at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2145) | |
E Caused by: java.io.FileNotFoundExcept |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@Before // <-- line 50 | |
fun setup() { | |
MockitoAnnotations.initMocks(this) | |
... | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open class BaseMagnetActivity : AppCompatActivity(), ScopeOwner { | |
private val scopeModel: ScopeModel by lazy { ScopeModel.setup(this) } | |
private var testScope: Scope? = null | |
override var scope: Scope | |
get() = testScope ?: scopeModel.scope | |
@VisibleForTesting | |
set(value) { | |
testScope = value |