Issue with API 32 or 33 with Coil
See original GitHub issueDescription
java.lang.NullPointerException
at androidx.core.os.BuildCompat.isAtLeastPreReleaseCodename(BuildCompat.java:60)
at androidx.core.os.BuildCompat.isAtLeastT(BuildCompat.java:211)
at androidx.core.content.ContextCompat.checkSelfPermission(ContextCompat.java:595)
at coil.util.-Contexts.isPermissionGranted(Contexts.kt:81)
at coil.network.NetworkObserverKt.NetworkObserver(NetworkObserver.kt:27)
at coil.util.SystemCallbacks.<init>(SystemCallbacks.kt:31)
at coil.RealImageLoader.<init>(RealImageLoader.kt:79)
at coil.ImageLoader$Builder.build(ImageLoader.kt:529)
at coil.ImageLoaders.create(ImageLoaders.kt:16)
at coil.Coil.newImageLoader(Coil.kt:64)
at coil.Coil.imageLoader(Coil.kt:29)
at coil.compose.ImageLoaderProvidableCompositionLocal.getCurrent(LocalImageLoader.kt:57)
at coil.compose.SingletonAsyncImagePainterKt.rememberAsyncImagePainter-MqR-F_0(SingletonAsyncImagePainter.kt:57)
at com.google.android.horologist.media.ui.components.MediaArtworkKt.MediaArtwork(MediaArtwork.kt:53)
at com.google.android.horologist.media.ui.components.MediaChipKt$MediaChip$appIcon$1$1.invoke(MediaChip.kt:80)
at com.google.android.horologist.media.ui.components.MediaChipKt$MediaChip$appIcon$1$1.invoke(MediaChip.kt:79)
Method is
protected static boolean isAtLeastPreReleaseCodename(@NonNull String codename,
@NonNull String buildCodename) {
// Special case "REL", which means the build is not a pre-release build.
if ("REL".equals(buildCodename)) {
return false;
}
// Otherwise lexically compare them. Return true if the build codename is equal to or
// greater than the requested codename.
final String buildCodenameUpper = buildCodename.toUpperCase(Locale.ROOT);
final String codenameUpper = codename.toUpperCase(Locale.ROOT);
return buildCodenameUpper.compareTo(codenameUpper) >= 0;
}
Steps to Reproduce
Bump project compileSdk to 33 and configure SDK 32 in Paparazzi.
Expected behavior
Image loaders work, or at least don’t fail.
Workaround
I created a FakeImageLoader for tests. Coil also allows you to disable the network observer.
Additional information:
- Paparazzi Version: 1.0
- OS: github linux
- Compile SDK: 33
- Gradle Version: 7.5
- Android Gradle Plugin Version: 7.3.0
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Change Log - Coil
Fix: RoundedCornersTransformation now properly scales the input bitmap. Remove dependency on the kotlin-parcelize plugin. Update compile SDK to 33. Downgrade ...
Read more >android:exported added but still getting error Apps targeting ...
I target to android SDK 33 now and it also works. The secret is the "androidx.test:core:1.4.0". It must be >= 1.4.0. Otherwise it...
Read more >Fix incompatibility when used with compileSdk 33 projects by ...
This means that projects using compileSdkVersion 33 will work as normal, just running on an API 32 host.
Read more >Refrigerator not cooling enough. Fridgidaire Gallery 2006-7?
Freezer is right at 32-33 degrees. I cleaned ice off the coils but still not working. The compressor seems to be running and...
Read more >HPLC troubleshooting guide - CCC
32. Method Verification. 33. Double Peaks in Sugar Separations. 34. Method Control ... The source of your column problem could for example be....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this fix from some of the other API 33 issues is relevant
Just in case somebody else is experiencing the same problem.
I also see this with any call to
androidx.compose.ui.text.android.BoringLayoutFactory.measure
, what some common Composables likeText
call.No issues with other composables though.
I am using
compileSdkVersion 33
&targetSdkVersion 33
kotlinCompilerExtensionVersion '1.3.2'
'androidx.compose:compose-bom:2022.10.00'
The error: