Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,18 @@ interface UIMessageResolver {
}
snackbar.show()
}
}

private fun getIndefiniteSnackbarWithAction(
view: View,
msg: String,
actionString: String,
actionListener: View.OnClickListener
) = Snackbar.make(view, msg, BaseTransientBottomBar.LENGTH_INDEFINITE).setAction(actionString, actionListener)
private fun getIndefiniteSnackbarWithAction(
Copy link
Contributor Author

@kidinov kidinov Aug 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to move it out of the interface otherwise it does not compile:

/Users/andrey/StudioProjects/woocommerce-android/WooCommerce/build/tmp/kapt3/stubs/wasabiDebug/com/woocommerce/android/ui/base/UIMessageResolver.java:171: error: private interface methods are not supported in -source 8
    private default com.google.android.material.snackbar.Snackbar getIndefiniteSnackbarWithAction(android.view.View view, java.lang.String msg, java.lang.String actionString, android.view.View.OnClickListener actionListener) {
                                                                                                 ^
  (use -source 9 or higher to enable private interface methods)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems correct, since the combination of private default doesn't make sense, since it can't be overridden. If this was a class it'd be okay, but since it is an interface it is not.

view: View,
msg: String,
actionString: String,
actionListener: View.OnClickListener
) = Snackbar.make(view, msg, BaseTransientBottomBar.LENGTH_INDEFINITE).setAction(actionString, actionListener)

private fun getSnackbarWithAction(
view: View,
msg: String,
actionString: String,
actionListener: View.OnClickListener
) = Snackbar.make(view, msg, BaseTransientBottomBar.LENGTH_LONG).setAction(actionString, actionListener)
}
private fun getSnackbarWithAction(
view: View,
msg: String,
actionString: String,
actionListener: View.OnClickListener
) = Snackbar.make(view, msg, BaseTransientBottomBar.LENGTH_LONG).setAction(actionString, actionListener)
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ allprojects {
// TODO fix all the warnings and change to true before end of 2022
allWarningsAsErrors = false
freeCompilerArgs += [
"-Xopt-in=kotlin.RequiresOptIn"
"-Xopt-in=kotlin.RequiresOptIn",
"-Xjvm-default=all-compatibility",
Copy link
Contributor Author

@kidinov kidinov Aug 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise tones of the:

Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option

Still can not figure out what and how exactly transitive dependency causes that compilation works differently

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is more info about these flags. It seems that this solution is the recommended solution for now.

I'm also not sure what caused this change though. My personal bet is that it seems the previous version of the SDK was compiled with org.jetbrains.kotlin:kotlin-stdlib-common:1.6.10 however, the new version is compiled with org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31 (yes, older). So I think Stripe changed some interfaces and annotations in the SDK which results in this change and we need to enable the compiler flag. Imo not worth investigating more unless we encounter some issues with it.

Screenshot 2022-09-09 at 17 13 14

]
}
}
Expand Down
2 changes: 1 addition & 1 deletion libs/cardreader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies {
androidTestImplementation "androidx.test.ext:junit:$jUnitExtVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"

implementation "com.stripe:stripeterminal:2.10.0"
implementation "com.stripe:stripeterminal:2.12.0"

// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
Expand Down