Git Product home page Git Product logo

moko-media's Introduction

moko-media
GitHub license Download kotlin-version

Mobile Kotlin media access

This is a Kotlin MultiPlatform library that provides media picking in common code (photo/video) and video player controls.

Table of Contents

Features

  • Capture camera photo
  • Pick image from gallery
  • Control video player
  • Compose Multiplatform support

Requirements

  • Gradle version 6.8+
  • Android API 16+
  • iOS version 11.0+

Installation

root build.gradle

allprojects {
    repositories {
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}

project build.gradle

dependencies {
    commonMainApi("dev.icerock.moko:media:0.11.0")

    // Compose Multiplatform
    commonMainApi("dev.icerock.moko:media-compose:0.11.0")

    commonTestImplementation("dev.icerock.moko:media-test:0.11.0")
}

Usage

class ViewModel(val mediaController: MediaPickerController) : ViewModel() {
    fun onSelectPhotoPressed() {
        launch {
            try {
                val bitmap = mediaController.pickImage(MediaControllerSource.CAMERA)
                // captured photo in bitmap
            } catch (_: CanceledException) {
                // cancel capture
            } catch (error: Throwable) {
                // denied permission or file read error
            }
        }
    }
}

android:

val viewModel = getViewModel {
    val permissionsController = PermissionsController()
    val mediaController = MediaPickerController(permissionsController)
    ViewModel(mediaController)
}

viewModel.mediaController.bind(
    lifecycle,
    supportFragmentManager
) // permissioncController bind automatically

iOS:

let permissionsController = PermissionsController()
let mediaController = MediaPickerController(permissionsController: permissionsController, viewController: self)
let viewModel = ViewModel(mediaController: mediaController)

Compose Multiplatform

@Composable
fun Sample() {
    val factory = rememberMediaPickerControllerFactory()
    val picker = remember(factory) { factory.createMediaPickerController() }
    val coroutineScope = rememberCoroutineScope()

    BindMediaPickerEffect(picker)

    var image: ImageBitmap? by remember { mutableStateOf(null) }

    image?.let {
        Image(bitmap = it, contentDescription = null)
    }

    Button(
        onClick = {
            coroutineScope.launch {
                val result = picker.pickImage(MediaSource.GALLERY)
                image = result.toImageBitmap()
            }
        }
    ) {
        Text(text = "Click on me")
    }
}

or with moko-mvvm (with correct configuration change on android):

@Composable
fun Sample() {
    val factory = rememberMediaPickerControllerFactory()
    val viewModel: SampleViewModel = getViewModel(
        key = "sample",
        factory = viewModelFactory {
            val picker = factory.createMediaPickerController()
            SampleViewModel(picker)
        }
    )

    BindMediaPickerEffect(viewModel.mediaPickerController)

    val image: Bitmap? by viewModel.image.collectAsState()
    val imageBitmap: ImageBitmap? = remember(image) { image?.toImageBitmap() }

    imageBitmap?.let {
        Image(bitmap = it, contentDescription = null)
    }

    Button(onClick = viewModel::onButtonClick) {
        Text(text = "Click on me")
    }
}

class SampleViewModel(
    val mediaPickerController: MediaPickerController
) : ViewModel() {
    private val _image: MutableStateFlow<Bitmap?> = MutableStateFlow(null)
    val image: StateFlow<Bitmap?> get() = _image

    fun onButtonClick() {
        viewModelScope.launch {
            try {
                _image.value = mediaPickerController.pickImage(MediaSource.GALLERY)
            } catch (exc: Exception) {
                println("error $exc")
            }
        }
    }
}

Samples

More examples can be found in the sample directory.

Set Up Locally

Contributing

All development (both new features and bug fixes) is performed in develop branch. This way master sources always contain sources of the most recently released version. Please send PRs with bug fixes to develop branch. Fixes to documentation in markdown files are an exception to this rule. They are updated directly in master.

The develop branch is pushed to master during release.

More detailed guide for contributers see in contributing guide.

License

Copyright 2019 IceRock MAG Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

moko-media's People

Contributors

alex009 avatar anton6tak avatar denmusic1992 avatar dorofeev avatar lobynya avatar rezmike avatar shelaranton avatar tetraquark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moko-media's Issues

Support bitmaps sampling for iOS

Need to add bitmaps sampling for pickImage function of MediaPickerController class (support of the max width and max height function arguments).
Android implementation has already been implemented in the #8.

Is it possible to add bind method to iOS?

Hello, the Android implementation (for example, MediaPickerController) has the bind(lifecycle: Lifecycle, fragmentManager: FragmentManager) method that has one other advantage except lifecycle management - it is common DI friendly, i.e. i can inject the picker into ViewModel and then bind it when ever i want.

But for iOS side you need to pass the UIViewController to the constructor of MediaPickerController which makes it hard to inject it in common code with, for example, Kodein. To make it work i created a copy of your MediaPickerController with the bind/unbind methods on iOS side and it works. Is it possible for you to implement something similar for people using common DI?

Example use case i have for it:

  • ios picker with bind
actual class ImagePicker(
    val permissionsController: PermissionsController // ,
//    private val getViewController: () -> UIViewController
) {
//    constructor(
//        permissionsController: PermissionsController,
//        viewController: UIViewController
//    ) : this(
//        permissionsController = PermissionsController,
//        getViewController = { viewController }
//    )

    private var getViewController: (() -> UIViewController)? = null

    fun bind(viewController: UIViewController) {
        getViewController = { viewController }
    }

    fun unbind() {
        getViewController = null
    }
// other methods
}
  • view model using it
class AccountViewModel constructor(
    // other dependencies
    val imagePicker: ImagePicker
) : BaseViewModel() {}
  • kodein config
// copied relevant code from different modules
    bind() from provider {
        PermissionsController()
    }
//...
    bind() from provider {
        ImagePicker(instance())
    }
//...
    bind() from provider {
        AccountViewModel(instance() /* the picker */, /* ... other dependencies */)
    }
//...
    fun getAccountViewModel() = kodein.direct.instance<AccountViewModel>()
  • SwiftUI ViewModel wrapper
class AccountViewModelWrap: BaseViewModelWrap {
    private let vm: AccountViewModel = InjectLocator().getAccountViewModel()

    func bindViewController(viewController: UIViewController) {
        self.vm.imagePicker.bind(viewController: viewController)
    }
// other code
  • SwiftUi view
struct AccountView: View {
    @StateObject var viewModel = AccountViewModelWrap()
    
    var body: some View {
        GeometryReader { geometry in
            NavigationView {
                ZStack {
                    PickerViewController(viewModel: self.viewModel)
                    VStack {
                   // other views
                   }
               }
            }
        }
    }
  • finally, picker view controller representable to bind the UIViewController
struct PickerViewController : UIViewControllerRepresentable {
    
    @ObservedObject var viewModel: AccountViewModelWrap
    
    func makeUIViewController(context: Context) -> UIViewController {
        let ctrl = UIViewController()
        self.viewModel.bindViewController(viewController: ctrl)
        return ctrl
    }
    
    // other stuff
}

and unbind is called onDisappear of the parent view.

Or maybe if you have a simpler solution - can you show please? :)

OutOfMemoryError for MediaPickerController

Got OutOfMemoryError for MediaPickerController:

java.lang.OutOfMemoryError: Failed to allocate a 159694860 byte allocation with 4193664 free bytes and 111MB until OOM
        at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
        at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
        at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:677)
        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:653)
        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:691)
        at dev.icerock.moko.media.picker.MediaPickerController$PickerFragment.processGalleryResult(MediaPickerController.kt:226)
        at dev.icerock.moko.media.picker.MediaPickerController$PickerFragment.onActivityResult(MediaPickerController.kt:202)

Implement sample

  • capture image/video from camera
  • pick image/video from gallery
  • cancel handling
  • permissions denied handling
  • pick files
  • play video

[iOS] Coroutines don't resume if picker screen was closed

When using MediaPickerController for pick image from gallery or for pick file, if you close picker screen with swipe down (available since iOS 13 for modal presented controllers), coroutine wouldn't resume.

In this case coroutine should be resumed with CanceledException

error with media on android api 30

There is an issue working with MOKO-Media and Permissions on android api 30.
When I use this line of code:

viewModelScope.launch {
            try {
                val image: Bitmap = mediaController.pickImage(mediaSource)
                ...
            } catch (error: Exception) {
                ....
            }

and click on "only this time" when allowing the app to use Camera permission, I encounter an exception:
java.lang.IllegalArgumentException: Failed to find configured root that contains /image.png

But when I call the pickImage method again, the permission dialog is not being called and the camera will open.

NullPointerException crash on pickFiles() call

NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
at com.nbsp.materialfilepicker.utils.FileUtils.getFileList(FileUtils.java:16)
at com.nbsp.materialfilepicker.ui.DirectoryFragment.initFilesList(DirectoryFragment.java:82)
at com.nbsp.materialfilepicker.ui.DirectoryFragment.onViewCreated(DirectoryFragment.java:78)

Could not find com.github.icerockdev:MaterialFilePicker:1.9.1.

Could not find com.github.icerockdev:MaterialFilePicker:1.9.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/icerockdev/MaterialFilePicker/1.9.1/MaterialFilePicker-1.9.1.pom
- https://repo.maven.apache.org/maven2/com/github/icerockdev/MaterialFilePicker/1.9.1/MaterialFilePicker-1.9.1.pom
- https://maven.pkg.jetbrains.space/public/p/compose/dev/com/github/icerockdev/MaterialFilePicker/1.9.1/MaterialFilePicker-1.9.1.pom
Required by:
project :composeApp > dev.icerock.moko:media:0.11.0 > dev.icerock.moko:media-android:0.11.0

Gradel:
implementation(libs.permissions.compose) // permissions api + compose extensions
// Media File Picker
implementation("com.darkrockstudios:mpfilepicker:3.1.0")
implementation("dev.icerock.moko:media:0.11.0")
implementation(libs.media.compose)
implementation("org.jetbrains.kotlinx:atomicfu:0.17.3")

FileUriExposedException for picking from camera, Android 10

I get exception FileUriExposedException when trying to get a picture from camera in Android 10:

W/System.err: android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/dev.icerock.moko.samples.media.debug/files/Pictures/image.png exposed beyond app through ClipData.Item.getUri()
        at android.os.StrictMode.onFileUriExposed(StrictMode.java:2083)
W/System.err:     at android.net.Uri.checkFileUriExposed(Uri.java:2388)
        at android.content.ClipData.prepareToLeaveProcess(ClipData.java:977)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:10759)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:10744)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1703)
        at android.app.Activity.startActivityForResult(Activity.java:5192)
        at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:675)
        at androidx.core.app.ActivityCompat.startActivityForResult(ActivityCompat.java:234)
        at androidx.fragment.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:795)
        at androidx.fragment.app.FragmentActivity$HostCallbacks.onStartActivityFromFragment(FragmentActivity.java:932)
        at androidx.fragment.app.Fragment.startActivityForResult(Fragment.java:1278)
        at androidx.fragment.app.Fragment.startActivityForResult(Fragment.java:1266)
        at dev.icerock.moko.media.picker.MediaPickerController$PickerFragment.pickCameraImage(MediaPickerController.kt:208)
W/System.err:     at dev.icerock.moko.media.picker.MediaPickerController.pickImage(MediaPickerController.kt:98)
        at dev.icerock.moko.media.picker.MediaPickerController.pickImage(MediaPickerController.kt:62)
        at com.icerockdev.library.ImageSelectionViewModel$onSelectImagePressed$1.invokeSuspend(ImageSelectionViewModel.kt:24)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

Photo capture logic with CameraView

Now library contains simple picker for selection from photo gallery or create photo from camera with system UI.
but for case when we add cameraview on own screen we not have any complete solution. With this reason on one project we already implement logic of photo capturing with:

  1. Android use library https://github.com/natario1/CameraView for capture photo
  2. after photo capturing we save photo to file and pass between screens only path to temporary file with photo, with this class:
    expect:
import dev.icerock.moko.media.Bitmap

expect class ImageFile {
    fun toBitmap(maxWidthPx: Int? = null, maxHeightPx: Int? = null): Bitmap
}

fun ImageFile.toBitmap(maxDimensionPx: Int): Bitmap = toBitmap(
    maxDimensionPx,
    maxDimensionPx
)

android actual:

import android.graphics.BitmapFactory
import android.graphics.Matrix
import androidx.exifinterface.media.ExifInterface
import dev.icerock.moko.media.Bitmap
import dev.icerock.moko.parcelize.Parcelable
import dev.icerock.moko.parcelize.Parcelize
import java.io.File
import android.graphics.Bitmap as AndroidBitmap

@Parcelize
actual class ImageFile(
    private val path: String
) : Parcelable {

    actual fun toBitmap(maxWidthPx: Int?, maxHeightPx: Int?): Bitmap {
        val file = File(this.path)

        val bitmapOptions: BitmapFactory.Options = readImageSize(file)
        val rotationDegrees: Int = readImageRotation(file)
        val sampleSize: Int? = calculateSampleSize(maxWidthPx, maxHeightPx, bitmapOptions)
        val sampledBitmap: AndroidBitmap = readSampledBitmap(file, sampleSize)
        val rotatedBitmap: AndroidBitmap = getRotatedBitmap(rotationDegrees, sampledBitmap)

        return Bitmap(rotatedBitmap)
    }

    private fun getRotatedBitmap(
        rotationDegrees: Int,
        sampledBitmap: AndroidBitmap
    ): AndroidBitmap {
        return if (rotationDegrees != 0) {
            val matrix = Matrix()
            matrix.postRotate(rotationDegrees.toFloat())

            AndroidBitmap.createBitmap(
                sampledBitmap,
                0, 0,
                sampledBitmap.width, sampledBitmap.height,
                matrix,
                true
            )
        } else {
            sampledBitmap
        }
    }

    private fun readSampledBitmap(
        file: File,
        sampleSize: Int?
    ): AndroidBitmap {
        val readingBitmapOptions = BitmapFactory.Options().apply {
            inJustDecodeBounds = false
            inSampleSize = sampleSize ?: 1
        }
        return file.inputStream().use { inputStream ->
            BitmapFactory.decodeStream(inputStream, null, readingBitmapOptions)
        } ?: throw IllegalArgumentException("can't decode file $file with $readingBitmapOptions")
    }

    private fun calculateSampleSize(
        maxWidthPx: Int?,
        maxHeightPx: Int?,
        bitmapOptions: BitmapFactory.Options
    ): Int? {
        return if (maxWidthPx != null || maxHeightPx != null) {
            val widthLimit = maxWidthPx ?: bitmapOptions.outWidth
            val heightLimit = maxHeightPx ?: bitmapOptions.outHeight

            calculateInSampleSize(
                options = bitmapOptions,
                maxWidth = widthLimit,
                maxHeight = heightLimit
            )
        } else {
            null
        }
    }

    private fun readImageRotation(file: File): Int {
        return file.inputStream().use { inputStream ->
            ExifInterface(inputStream)
        }.rotationDegrees
    }

    private fun readImageSize(file: File): BitmapFactory.Options {
        return file.inputStream().use { inputStream ->
            val bitmapOptions = BitmapFactory.Options().apply {
                inJustDecodeBounds = true
            }

            BitmapFactory.decodeStream(inputStream, null, bitmapOptions)

            bitmapOptions
        }
    }

    private fun calculateInSampleSize(
        options: BitmapFactory.Options,
        maxWidth: Int,
        maxHeight: Int
    ): Int {
        val (height: Int, width: Int) = options.run { outHeight to outWidth }
        var inSampleSize = 1

        if (height > maxHeight || width > maxWidth) {

            val halfHeight: Int = height / 2
            val halfWidth: Int = width / 2

            while (halfHeight / inSampleSize >= maxHeight && halfWidth / inSampleSize >= maxWidth) {
                inSampleSize *= 2
            }
        }

        return inSampleSize
    }
}

ios actual:

import dev.icerock.moko.media.Bitmap

actual class ImageFile(
    private val bitmap: Bitmap
) {
    actual fun toBitmap(maxWidthPx: Int?, maxHeightPx: Int?): Bitmap {
        return bitmap
    }
}
  1. in application we can use multiple ImageFile without OutOfMemory on android, because all images just on storage, not in RAM. on iOS now logic with files not implemented (here more available memory for images)...

i think we should have in moko-media out of box solution for this case and allow devs to not think about photo capturing problems.

also for android i think we can try https://developer.android.com/training/camerax

Update readme

  • logo (?)
  • description with goals
  • gif with clear example in action
  • features - camera capture, gallery image/video pick, coroutines based api, file picker, video player common controller
  • simple usage (capture photo from camera, select video from gallery, show video in preview)
  • installation steps
  • detailed usage
  • how to contribute
  • license block

fix rotation for specific devices

There is a problem with a photo rotation. The method for picking images returns an image rotated 90 degrees.
When i use this code:

val image: Bitmap = mediaController.pickImage(mediaSource)

it doesn't work as I expect for some devices, like
LG X Power / Android 6.0.1 / 5,3 display
Nexus one / Android 7.0 / 3.4 480x800 hdpi

The expected behavior is when the returned image is rotated properly.

find libs error

lasest,can not find com.github.icerockdev:MaterialFilePicker

java.lang.ClassCastException ( MediaPickerFragment cannot be cast to ImagePickerFragment)

coroutineScope.launch {
                            //var image: ImageBitmap? by remember { mutableStateOf(null) }
                            val result = picker.pickImage(MediaSource.CAMERA)
                            try {
                                result.toImageBitmap()
                            } catch (e: Exception) {

                            }
                        }
java.lang.ClassCastException: dev.icerock.moko.media.picker.MediaPickerFragment cannot be cast to dev.icerock.moko.media.picker.ImagePickerFragment
                                                                                                    	at dev.icerock.moko.media.picker.MediaPickerControllerImpl.pickImage(MediaPickerControllerImpl.kt:62)
                                                                                                    	at dev.icerock.moko.media.picker.MediaPickerControllerImpl.pickImage(MediaPickerControllerImpl.kt:44)

How usage moko-media and moko-permissions in now update compose multiplatform. Resolve Fragment Activity bugs

I was having trouble launching the gallery in cross-platform composition on the Android platform. My problem is that the fragment activity was not initialized when entering the screen with the BindMediaPickerEffect(mediaPicker) method. Solve this problem when change in ComposableActivity() to FragmentActivity() in MainActivity.kt

MainActivity.kt in android package

image

How to usage moko-media and moko-permissions in compose multiplatform 2024

To use moko-media and moko-permissions in cross-platform composition, follow the steps below:

  • 1 - Install dependencys in build.gradle commons packeage
commonMain.dependencies {
            // Media File Picker
            implementation("com.darkrockstudios:mpfilepicker:3.1.0")

           // Moko Permissions
            implementation("dev.icerock.moko:permissions:0.17.0")

            // Moko Permissions Compose
            implementation("dev.icerock.moko:permissions-compose:0.17.0")

            // Moko Media Compose
            implementation("dev.icerock.moko:media-compose:0.11.0")
}
  • 2 - Invoke moko permissions and moko media factory and usage to invoke controller. This controllers method usage in BindEffect( permissions controller) and BindMediaPickerEffect(media controller). Follow this example:

⚠️⚠️⚠️ ATTENTION: not remove remember to instancy controller, because crash app. ⚠️⚠️⚠️

@Composable
fun Content() {
        val coroutineScope = rememberCoroutineScope()

        val mediaFactory = rememberMediaPickerControllerFactory()
        val mediaPicker = remember(mediaFactory) { mediaFactory.createMediaPickerController() }

        val permissionFactory: PermissionsControllerFactory = rememberPermissionsControllerFactory()
        val permissionController: PermissionsController = remember(permissionFactory) {
            permissionFactory.createPermissionsController()
        }

        BindEffect(permissionController)
        BindMediaPickerEffect(mediaPicker)

        Button(
            onClick = {
                ViewModel.openPhoto(
                    coroutineScope = coroutineScope,
                    mediaPickerController = mediaPicker,
                    permissionsController = permissionController
                )
          }
       ) {
            Text(text = "Click on me")
       }
}

in ViewModel, this function usage to open gallary and manipulate show image selected in your screen

class RegisterPhotoScreenModel : ViewModel() {
    fun openPhoto(
        coroutineScope: CoroutineScope,
        mediaPickerController: MediaPickerController,
        permissionsController: PermissionsController
    ) {
        coroutineScope.launch {
            try {
                permissionsController.providePermission(Permission.GALLERY)
                val result = mediaPickerController.pickImage(MediaSource.GALLERY)
                val imageBitmap = result.toImageBitmap()
                // Update your livedata or mutableStateFlow with imageBitmap and colect in screen.
            } catch (deniedAlways: DeniedAlwaysException) {

                // TODO add snackbar with action button redirect user to config app.

            } catch (denied: DeniedException) {

                // TODO add snackbar with action button redirect user to config app.

            }
        }
    }
}

Not open camera in Android compose multiplatform

Hello!
I using your library to open camera in my app with compose multplatform, but the permission and function to open camera not open in android and ios app show permission and Camera. I adding permissions in androidManifest.xml.

Android Manifest

image

My Screen

image

Screen Model( ViewModel ) (I use Koin to dependency injection, passed factory per params to use library)

image

Test IOS

Gravacao.de.Tela.2023-12-27.as.01.11.43.mov

Test Android

Gravacao.de.Tela.2023-12-27.as.01.14.02.mov

Prevent file compress

By default the video files in iOS photo picker compresses the selected file, How to prevent this

issue while uploading file

FATAL EXCEPTION: main
Process: xyz.penpencil.unigo, PID: 27196
java.lang.RuntimeException: Unable to start activity ComponentInfo{xyz.penpencil.unigo/com.nbsp.materialfilepicker.ui.FilePickerActivity}: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 1: TypedValue{t=0x2/d=0x7f0300ad a=6 r=0x7f050055}
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3846)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4022)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2336)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8653)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 1: TypedValue{t=0x2/d=0x7f0300ad a=6 r=0x7f050055}
at android.content.res.TypedArray.getColor(TypedArray.java:528)
at android.app.Activity.onApplyThemeResource(Activity.java:5161)
at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java:216)
at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java:147)
at android.app.Activity.setTheme(Activity.java:5139)
at androidx.appcompat.app.AppCompatActivity.setTheme(AppCompatActivity.java:146)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3812)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.