question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build failure with v 4.0.0 (error: image must not be null)

See original GitHub issue

Hi, I’m getting following error with plugin when using in a hello world (jetpack compose) project with minSdk 24 & targetSdk 30

Execution failed for task ‘:app:easylauncherDebug’.

image must not be null

in app/build.gradle i’ve

plugins { id ‘com.starter.easylauncher’ version ‘4.0.0’ }

Example Project setup/ configs

defaultConfig {
    applicationId "com.example.ribbontest"
    minSdk 24
    targetSdk 30
    versionCode 1
    versionName "1.0"

    vectorDrawables {
        useSupportLibrary true
    }
}
Screenshot 2021-08-14 at 22 40 05

Also tried to specify iconNames like below but it didn’t help
easylauncher { iconNames = [“@mipmap/ic_launcher”, “@mipmap/ic_launcher_round”] }

Does work ONLY if full folder name is specified easylauncher { iconNames = [“@mipmap-anydpi-v26/ic_launcher_round”] }

But it causes then another issue/ app crashes if i try to use that icon in app somewhere e.g. in splash screen

java.lang.IllegalArgumentException: Only VectorDrawables and rasterized asset types are supported ex. PNG, JPG
    at androidx.compose.ui.res.PainterResources_androidKt.loadVectorResource(PainterResources.android.kt:85)
Image(
            modifier = Modifier.scale(scale.value),
            painter = painterResource(id = R.mipmap.ic_launcher), // same result with R.mipmap.ic_launcher_round, R.drawable.ic_launcher_foreground
            contentDescription = null
        )

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
miduchcommented, Aug 23, 2021

painter = painterResource(id = R.drawable.ic_launcher_foreground)

Ah, I understood you aimed to load R.mipmap.ic_launcher not R.drawable.ic_launcher_foreground

ic_launcher on >26 api levels is an adaptive icon resource, which I do’t ic_launcher_foreground and ic_launcher_round is a layer-list drawable, which doesn’t seem to be supported by Compose

I don’t know what you aim for, but the layer-list drawable is the way the plugin injects itself to adds overlay to app icon. If you loaded the ic_launcher_foreground resource to plain old ImageView - it would work as expected, so it seems like the issue is with Compose. Feel free to report an issue to Compose Team and see what they reply 😃

This just happened to be randomly selected drawable to be shown in Image composable I had in sample app when trying ribbon plugin otherwise no reason to pick that specific drawable 😃

1reaction
miduchcommented, Aug 15, 2021

I’m guessing the plugin doesn’t support webps and I’d have to do some research if adding support for such would be feasible 👀 As a workaround I can only suggest using pngs as launcher images.

android studio artic fox by default is creating webp for new project when created from wizard. if plugin doesn’t support webp (yet?) then atleast this should be mentioned in plugin’s ReadMe or somewhere

Read more comments on GitHub >

github_iconTop Results From Across the Web

i can't solve maven building error failure - Stack Overflow
I have fixed this issue by deleting local .m2/repository folder. The build is successful now.
Read more >
Error: "<image> must have a non-null <name>" #614 - GitHub
My workaround was to set pom.xml/alias to match “name” from docker-compose (for the image that requires a build and is not just pulled...
Read more >
[platformmanagement_public_802]Can't create ImageStream ...
Description of problem: Use docker image which have more than two slashes to create new build, the ImageStream created failed with ...
Read more >
Changelog - Cypress Documentation
Cypress now throws an error if any Cypress commands are invoked from inside ... With this change, cy.session() will no longer fail validation...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
... Bug:131367 - "GNAP fails to build extensions if no useflags declared" status:RESOLVED ... error: wx/image.h: No such file or directory" status:RESOLVED ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found