Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] lateinit property imageAdapter has not been initialized #262

Open
KoheiMoroi opened this issue Jan 30, 2023 · 1 comment
Open

[BUG] lateinit property imageAdapter has not been initialized #262

KoheiMoroi opened this issue Jan 30, 2023 · 1 comment
Assignees
Labels

Comments

@KoheiMoroi
Copy link

Describe the bug
Using the latest version 1.1.1, we still face that early crash UninitializedPropertyAccessException by imageAdapter on our production app.
For addressing the crash, could you please reconsider this PR?

Similar issues:

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

Smartphone (please complete the following information):

  • Device: AQUOS, Experia, Oppo, Xiaomi, Pixel and so on.
  • OS: Android8 ~ Android12
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@BorlandDev
Copy link

BorlandDev commented Feb 28, 2023

I bring my code:

private val contentGallery =
    registerForActivityResult(StartActivityForResult()) {
        if (it.resultCode == AppCompatActivity.RESULT_OK) {
            path = it.data?.getParcelableArrayListExtra(FishBun.INTENT_PATH) ?: arrayListOf()
            navigateToUploadPhotosFragment(path)
        }
    }

private fun openGallery() {
if (PickVisualMedia.isPhotoPickerAvailable())
contentGalleryWithHigherApi.launch(
PickVisualMediaRequest(PickVisualMedia.ImageOnly)
)
else {
FishBun.with(this)
.setImageAdapter(GlideAdapter())
.setAlbumSpanCountOnlyLandscape(1)
.setMaxCount(5)
.setIsUseDetailView(false)
.setActionBarColor(
Color.parseColor("#213454"),
Color.parseColor("#213454"), false
)
.setActionBarTitleColor(Color.parseColor("#FFFFFF"))
.textOnImagesSelectionLimitReached(requireContext().resources.getString(R.string.gallery_hint))
.startAlbumWithActivityResultCallback(contentGallery)
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants