Skip to content

Commit

Permalink
fix: Fix crashes by ensuring layout ID is set before inflating Camera…
Browse files Browse the repository at this point in the history
… View stub + raise AGP for Kotlin 1.7.0 compatibility (#4794)

* Fix 4685, 4686 by inflating the Camera View stub before attempting to set its visibility.

* - Raise minSdk to 24 to support usage of certain Kotlin stdlib functions

* - Update Android Gradle Plugin version to 7.2.1 for Kotlin 1.7 compatibility

* - Apply package change suggestion

* build: revert to minSdk 21

Co-authored-by: Pierre Slamich <[email protected]>
Co-authored-by: VaiTon <[email protected]>
  • Loading branch information
3 people committed Jul 19, 2022
1 parent b09ce5f commit a39d366
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ android {
}

lint {
isAbortOnError = false
abortOnError = false

disable(
disable += setOf(
"MissingTranslation",
"ImpliedQuantity",
// Invalid Resource Folder is for values-b+sr… folders
Expand Down
2 changes: 1 addition & 1 deletion app/src/androidTestScreenshots/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:tools="http:https://schemas.android.com/tools"
package="openfoodfacts.github.scrachx.openfood">
package="openfoodfacts.github.scrachx.openfood.test">

<uses-sdk tools:overrideLibrary="android_libs.ub_uiautomator" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ abstract class CameraView<T : FrameLayout>(
return
}

viewStub.isVisible = true
viewStub.layoutResource = resId
view = viewStub.inflate() as T
viewStub.isVisible = true
}

@CallSuper
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ buildscript {
maven("https://jitpack.io")
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.android.tools.build:gradle:7.2.1")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit a39d366

Please sign in to comment.