codekidX / storage-chooser

Lets user choose files in internal or external storage with just few lines of code.
Mozilla Public License 2.0
721 stars 153 forks source link

Incorrect behaviour while rotating the screen #106

Closed artyomefimov closed 5 years ago

artyomefimov commented 5 years ago

When I rotate a screen while choosing a storage, I get an incorrect folder path. In logs I get an empty string. Before After

codekidX commented 5 years ago

I'll fix this in the upcoming version, 2.5. Thanks for letting me know.

artyomefimov commented 5 years ago

@codekidX, good day! Can you please let me know in this issue when 2.5 will be released? Thanks in advance.

codekidX commented 5 years ago

@artyomefimov please let me know the following things:

  1. the version of the library you are using
  2. how to replicate this issue again and again

I currently tested on my device with the latest version 2.0.4.3 and there seems to be no issue while rotating (there used to be an issue in 1.0 but it was fixed).

artyomefimov commented 5 years ago

@codekidX,

  1. I use 2.0.4.2 version.
  2. I tested this issue on Android emulators (API 22 and 28) and real device (API 24). Steps to reproduce are the following:

Should I try the 2.0.4.3 version?

artyomefimov commented 5 years ago

With the 2.0.4.3 version I got this problem:


Android resource linking failed
storage-chooser-2.0.4.3.aar\3b92abd5f74cf751e8afa0bda9fbcf37\res\layout\custom_storage_list.xml:156: error: attribute cb_color (aka com.artyomefimov.soundrecorder:cb_color) not found.
storage-chooser-2.0.4.3.aar\3b92abd5f74cf751e8afa0bda9fbcf37\res\layout\custom_storage_list.xml:156: error: attribute cb_pressedRingWidth (aka com.artyomefimov.soundrecorder:cb_pressedRingWidth) not found.
storage-chooser-2.0.4.3.aar\3b92abd5f74cf751e8afa0bda9fbcf37\res\layout-v21\custom_storage_list.xml:155: error: attribute cb_color (aka com.artyomefimov.soundrecorder:cb_color) not found.
storage-chooser-2.0.4.3.aar\3b92abd5f74cf751e8afa0bda9fbcf37\res\layout-v21\custom_storage_list.xml:155: error: attribute cb_pressedRingWidth (aka com.artyomefimov.soundrecorder:cb_pressedRingWidth) not found.
error: failed linking file resources.
codekidX commented 5 years ago

@artyomefimov I have just released 2.0.4.4 with some merge related fixes.

Do let me know if this issue persists in this version.

artyomefimov commented 5 years ago

@codekidX with the 2.0.4.4 I get Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0-beta01] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). In the 2.0.4.2 there were no problems like this.

codekidX commented 5 years ago

@artyomefimov Add two lines in gradle.properties file:

android.useAndroidX=true android.enableJetifier=true

Please confirm if this issue resolves, so that I can update it in README

artyomefimov commented 5 years ago

@codekidX now I have no problems with building my app. Thanks for help. But the initial problem is still exists.

codekidX commented 5 years ago

@artyomefimov I see that you are working on the sound recorder app?

add android:configChanges="orientation|screenSize"

Edit: In your AndroidManifest.xml activity tag.

this helps the library to store changes during orientation and your issue should be fixed.

artyomefimov commented 5 years ago

@codekidX it works! Thanks for your help, I close the issue.