Android Studio and SMBJ - android

I am trying to make a File List from my SMB Shared Folder with Android Studio.
I want to press a Button in my Android App and then get the List stored as *.txt in my root or SD Card Root.
I am using Android Studio API Version Level 30 and SMBJ Library.
But I'm failing in connection for my SMB Share.
When I press the button with the code its crashing without giving a Message on my Samsung Galaxy S20.
I found that the crash happens on following 2 lines:
AuthenticationContext ac = new AuthenticationContext("admin", "password123".toCharArray(),null);
Session session = connection.authenticate(ac);
I am not sure if I need the domain.
I have no domain installed and tried some different things.
SMBClient client = new SMBClient();
try {
Connection connection = client.connect("192.168.1.75");
AuthenticationContext ac = new AuthenticationContext("admin", "password123".toCharArray(),null);
Session session = connection.authenticate(ac);
//DiskShare share = (DiskShare) session.connectShare("Intel");
} catch (Exception e) {
txt.setText(e.toString());
}
The following is from the SMBJ Website on GIT:
https://github.com/hierynomus/smbj
SMBClient client = new SMBClient();
try (Connection connection = client.connect("SERVERNAME")) {
AuthenticationContext ac = new AuthenticationContext("USERNAME", "PASSWORD".toCharArray(), "DOMAIN");
Session session = connection.authenticate(ac);
// Connect to Share
try (DiskShare share = (DiskShare) session.connectShare("SHARENAME")) {
for (FileIdBothDirectoryInformation f : share.list("FOLDER", "*.TXT")) {
System.out.println("File : " + f.getFileName());
}
}
}
This is the error log I get:
2022-04-25 11:45:27.475 22865-22865/com.example.filme E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.filme, PID: 22865
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/slf4j/LoggerFactory;
at com.hierynomus.smbj.SMBClient.<clinit>(SMBClient.java:119)
at com.example.filme.MainActivity$1.onClick(MainActivity.java:36)
at android.view.View.performClick(View.java:7792)
at android.widget.TextView.performClick(TextView.java:16112)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View.performClickInternal(View.java:7769)
at android.view.View.access$3800(View.java:910)
at android.view.View$PerformClick.run(View.java:30213)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.slf4j.LoggerFactory" on path: DexPathList[[dex file "/data/data/com.example.filme/code_cache/.overlay/base.apk/classes3.dex", dex file "/data/data/com.example.filme/code_cache/.overlay/base.apk/classes.dex", zip file "/data/app/~~SMMMBpkYv1Fu0fT2H1M_sA==/com.example.filme-ovE-fLeCY69AhQvQzyn1cA==/base.apk"],nativeLibraryDirectories=[/data/app/~~SMMMBpkYv1Fu0fT2H1M_sA==/com.example.filme-ovE-fLeCY69AhQvQzyn1cA==/lib/arm64, /system/lib64, /system/system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.hierynomus.smbj.SMBClient.<clinit>(SMBClient.java:119) 
at com.example.filme.MainActivity$1.onClick(MainActivity.java:36) 
at android.view.View.performClick(View.java:7792) 
at android.widget.TextView.performClick(TextView.java:16112) 
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119) 
at android.view.View.performClickInternal(View.java:7769) 
at android.view.View.access$3800(View.java:910) 
at android.view.View$PerformClick.run(View.java:30213) 
at android.os.Handler.handleCallback(Handler.java:938) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loopOnce(Looper.java:226) 
at android.os.Looper.loop(Looper.java:313) 
at android.app.ActivityThread.main(ActivityThread.java:8663) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) 
2022-04-25 11:45:27.518 22865-22865/com.example.filme I/Process: Sending signal. PID: 22865 SIG: 9
tried to install library slf4j-android-1.7.9.jar
but dont works for now.
Edit 12:46 o clock:
I added now many libraries and now its going close to work but not fully.
No library is missing but the following error occurs:
android.os.NetworkOnMainThreadException error
I read that I must do asynchronous processing.
But I'm too stupid to write this asynchronous code.. can anyone help?

Now its working.
I needed following LIBRARIES:
asn-one-0.6.0.jar
bcprov-jdk15on-1.70.jar
mbassador-1.3.2.jar
slf4j-api-1.7.9.jar
slf4j-nop-1.7.9.jar
smbj-0.11.5.jar

Related

Kotlin Multiplatform + Sentry

I want to use Sentry for my Multiplatform Kotlin project.
Sentry for Kotlin Multiplatform
So I was trying to prepare the setup of Sentry with Kotlin Multiplatform.
I was following the guide, made a mavenLocal() build etc.
Now I wanted to add it to the project.
However, when starting my (Android) project, even before starting the onCreate() of the Application I get a crash stating:
Unable to get provider io.sentry.android.core.SentryInitProvider:
java.lang.IllegalArgumentException: DSN is required. Use empty string to disable SDK.
So to be clear this happens already when adding api("io.sentry:sentry-kotlin-multiplatform:0.0.1") to the dependencies. Long before the init call.
All I did was:
Configure shared build.gradle.kts and add
val commonMain by getting {
dependencies {
api("io.sentry:sentry-kotlin-multiplatform:0.0.1")
Adding the sample configuration
fun initializeSentry(context: Context) {
Sentry.init(context) { sentryOptions -> setDsnHere... }
}
and in the Android Application:
initializeSentry(this)
Then tried to run it. But I don't even get to the init call.
The configuration should be reached and the initializeSentry(this) block executed. (I can accept if it fails there but I don't even get that far.)
Instead the app fails stating
E/AndroidRuntime: FATAL EXCEPTION: main
Process: xyz, PID: 23056
java.lang.RuntimeException: Unable to get provider io.sentry.android.core.SentryInitProvider: java.lang.IllegalArgumentException: DSN is required. Use empty string to disable SDK.
at android.app.ActivityThread.installProvider(ActivityThread.java:7467)
...
even before anything else.
So the mere adding to the gradle file causes the crash already (even if the other code is commented out).
-------- Full Stack trace-------
java.lang.RuntimeException: Unable to get provider io.sentry.android.core.SentryInitProvider: java.lang.IllegalArgumentException: DSN is required. Use empty string to disable SDK.
at android.app.ActivityThread.installProvider(ActivityThread.java:7467)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6973)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6744)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2133)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: java.lang.IllegalArgumentException: DSN is required. Use empty string to disable SDK.
at io.sentry.Sentry.initConfigurations(Sentry.java:201)
at io.sentry.Sentry.init(Sentry.java:170)
at io.sentry.Sentry.init(Sentry.java:118)
at io.sentry.android.core.SentryAndroid.init(SentryAndroid.java:87)
at io.sentry.android.core.SentryAndroid.init(SentryAndroid.java:56)
at io.sentry.android.core.SentryInitProvider.onCreate(SentryInitProvider.java:27)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2451)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2421)
at io.sentry.android.core.SentryInitProvider.attachInfo(SentryInitProvider.java:44)
at android.app.ActivityThread.installProvider(ActivityThread.java:7462)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6973) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6744) 
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2133) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loopOnce(Looper.java:201) 
at android.os.Looper.loop(Looper.java:288) 
at android.app.ActivityThread.main(ActivityThread.java:7872) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) 
Turns out the manual had forgotten to mention the auto configuration.
Add this line to your Manifest:
<meta-data android:name="io.sentry.auto-init" android:value="false" />
and proceed with the tutorial.
For Reference:
https://github.com/getsentry/sentry-kotlin-multiplatform/issues/45

Google pay library to scan debit/credit card details like card number, expiry date and CVV, facing an issue on Production its working on QA

I have implemented the google pay library to scan debit/credit card details, its working fine in the QA environment but when I try to test it on production I am facing a crash.
https://developers.google.com/pay/payment-card-recognition/debit-credit-card-recognition
private fun createPaymentsClient(activity: Activity): PaymentsClient {
val walletOptions = Wallet.WalletOptions.Builder()
.setEnvironment(WalletConstants.ENVIRONMENT_PRODUCTION)
.build()
return Wallet.getPaymentsClient(activity, walletOptions)
}
when I change environment to "WalletConstants.ENVIRONMENT_PRODUCTION" from "setEnvironment(Constants.PAYMENTS_ENVIRONMENT)" facing the crash below is crash log
FATAL EXCEPTION: main
Process: com.dhl.pay.google, PID: 5219
kotlin.UninitializedPropertyAccessException: lateinit property cardRecognitionPendingIntent has not been initialized
at com.dhl.pay.google.MainActivity.startPaymentCardOcr(MainActivity.kt:80) at com.dhl.pay.google.MainActivity.onCreate$lambda$0(MainActivity.kt:38) at com.dhl.pay.google.MainActivity.$r8$lambda$9ZIx61lkQCSM4mTsrQGymHGsZ_g(Unknown Source:0) at com.dhl.pay.google.MainActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:2) at android.view.View.performClick(View.java:7488)
at android.view.View.performClickInternal(View.java:7464) at android.view.View.access$3700(View.java:841)
at android.view.View$PerformClick.run(View.java:28911)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:344)
at android.app.ActivityThread.main(ActivityThread.java:8212)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)

Error while doing phone authentication on firebase

While doing phone number authentication on firebase i'm getting crash with this error message. please help.
com.russvkm.chathut is my package name
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.russvkm.chathut, PID: 24323
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/browser/customtabs/CustomTabsIntent$Builder;
at com.google.firebase.auth.internal.RecaptchaActivity.zza(com.google.firebase:firebase-auth##20.0.0:92)
at com.google.firebase.auth.api.internal.zzeq.zza(com.google.firebase:firebase-auth##20.0.0:79)
at com.google.firebase.auth.api.internal.zzeq.onPostExecute(com.google.firebase:firebase-auth##20.0.0:88)
at android.os.AsyncTask.finish(AsyncTask.java:695)
at android.os.AsyncTask.access$600(AsyncTask.java:180)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6826)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.browser.customtabs.CustomTabsIntent$Builder" on path: DexPathList[[zip file "/data/app/com.russvkm.chathut-22XI8m2uPLL7Q6CgxXHPiw==/base.apk"],nativeLibraryDirectories=[/data/app/com.russvkm.chathut-22XI8m2uPLL7Q6CgxXHPiw==/lib/arm, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.firebase.auth.internal.RecaptchaActivity.zza(com.google.firebase:firebase-auth##20.0.0:92) 
at com.google.firebase.auth.api.internal.zzeq.zza(com.google.firebase:firebase-auth##20.0.0:79) 
at com.google.firebase.auth.api.internal.zzeq.onPostExecute(com.google.firebase:firebase-auth##20.0.0:88) 
at android.os.AsyncTask.finish(AsyncTask.java:695) 
at android.os.AsyncTask.access$600(AsyncTask.java:180) 
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:201) 
at android.app.ActivityThread.main(ActivityThread.java:6826) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) 
I/Process: Sending signal. PID: 24323 SIG: 9
my application is communicating well with firebase server as i don't find any error or crash while doing email authentication.
I'm using following approach to authenticate
PhoneAuthProvider.verifyPhoneNumber(
PhoneAuthOptions.newBuilder(mAuth)
.setPhoneNumber(phoneNumber)
.setActivity(this)
.setTimeout(60,TimeUnit.SECONDS)
.setCallbacks(object:PhoneAuthProvider.OnVerificationStateChangedCallbacks(){
override fun onVerificationCompleted(credential:PhoneAuthCredential) {
dismissDialog()
val smsCode=credential.smsCode
Log.i("SMS code",smsCode!!)
signInWithPhoneAuthCredential(credential)
}
override fun onVerificationFailed(p0: FirebaseException) {
Toast.makeText(this#Register,p0.message,Toast.LENGTH_SHORT).show()
}
override fun onCodeSent(verificationId: String, token: PhoneAuthProvider.ForceResendingToken) {
super.onCodeSent(verificationId, token)
numberLinearLayout.visibility=View.GONE
otpLinearLayout.visibility=View.VISIBLE
storedVerificationId=verificationId
resendToken=token
dismissDialog()
}
})
.build()
)
programme isn't executing otpSent method it is being crashed without sending otp.
Firebase auth got some major changes, like Recaptcha for human verification.it needs a browser to verify so, Add the below depen. and read about changes refer me
implementation 'androidx.browser:browser:1.2.0'
Update :
If you want to avoid human verification, you need to enable safetynet in google cloud console for your firebase project refer this.
By adding
implementation "androidx.browser:browser:1.3.0"
it solved my problem but user experience was not good because firebase was opening browser to verify Recaptcha and that was looking odd in app flow.
Firebase Quote "The reCAPTCHA flow will only be triggered when SafetyNet is unavailable or your device does not pass suspicion checks. Nonetheless, you should ensure that both scenarios are working correctly."
So to enable SafetyNet follow below steps or you can also visit Firebase Auth for more info.
1.Go to google cloud console , select your project .
2.Click on navigation menu and select APis & services and then select Dashboard.
3.Click on enable api and services and enable api " Android Device Verification".
4.Add SHA 256 in firebase project settings. (debug and release both)
5.Test your app again.(For testing use real device not emulator)

running python in android app with chaquopy yields fatal error

I'm try to run python code in my android app using Chaquopy, I'm also using the moviepy library (I'm converting a mp4 file to a gif file). When I try to do the conversion I get the following error message:
2019-02-06 15:46:47.586 3924-3924/com.udacity.gradle.builditbigger E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.udacity.gradle.builditbigger, PID: 3924
com.chaquo.python.PyException: AttributeError: module 'moviepy.audio.fx.all' has no attribute 'audio_fadein'
at <python>.moviepy.editor.<module>(<string>:1)
at <python>.moviepy.editor.<module>(editor.py:80)
at <python>.java.android.importer.load_module_impl(importer.py:435)
at <python>.java.android.importer.load_module(importer.py:353)
at <python>.importlib._bootstrap._load_backward_compatible(<frozen importlib._bootstrap>:626)
at <python>.importlib._bootstrap._load_unlocked(<frozen importlib._bootstrap>:656)
at <python>.importlib._bootstrap._find_and_load_unlocked(<frozen importlib._bootstrap>:955)
at <python>.importlib._bootstrap._find_and_load(<frozen importlib._bootstrap>:971)
at <python>.java.chaquopy.import_override(import.pxi:18)
at <python>.gif_convert.<module>(gif_convert.py:1)
at <python>.java.android.importer.load_module_impl(importer.py:435)
at <python>.java.android.importer.load_module(importer.py:353)
at <python>.importlib._bootstrap._load_backward_compatible(<frozen importlib._bootstrap>:626)
at <python>.importlib._bootstrap._load_unlocked(<frozen importlib._bootstrap>:656)
at <python>.importlib._bootstrap._find_and_load_unlocked(<frozen importlib._bootstrap>:955)
at <python>.importlib._bootstrap._find_and_load(<frozen importlib._bootstrap>:971)
at <python>.importlib._bootstrap._gcd_import(<frozen importlib._bootstrap>:994)
at <python>.importlib.import_module(__init__.py:126)
at <python>.chaquopy_java.Java_com_chaquo_python_Python_getModule(chaquopy_java.pyx:154)
at com.chaquo.python.Python.getModule(Native Method)
at com.udacity.gradle.builditbigger.newPost.visualMediaPost.VisualMediaPostFragment.moveFile(VisualMediaPostFragment.java:247)
at com.udacity.gradle.builditbigger.camera.LifeCycleCamera.getFilePath(LifeCycleCamera.java:1161)
at com.udacity.gradle.builditbigger.camera.LifeCycleCamera.stopRecordingVideo(LifeCycleCamera.java:1078)
at com.udacity.gradle.builditbigger.newPost.visualMediaPost.VisualMediaPostFragment.lambda$onCreateView$5(VisualMediaPostFragment.java:162)
at com.udacity.gradle.builditbigger.newPost.visualMediaPost.-$$Lambda$VisualMediaPostFragment$WS1G2y9p8sE-re_eOWFa7Rr0OCU.onClick(Unknown Source:4)
at android.view.View.performClick(View.java:6897)
at android.view.View$PerformClick.run(View.java:26089)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6940)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
I've found a fix for this problem (it involves changing the python code that would normally be generated by android studio, so any changes made to the python files will be overwritten during build time.
The python code is shown below
from moviepy.editor import VideoFileClip
def convert(path):
clip = VideoFileClip(path)
return clip.write_gif("output.gif", fps=24)
The java code used to start the pyhton code:
Python.start(new AndroidPlatform(getActivity()));
Python py = Python.getInstance();
PyObject gifConvert = py.getModule("gif_convert");
PyObject gif = gifConvert.callAttr("convert", file.getAbsolutePath());
Log.i("gif type", gif.toString());
Any help would be greatly appreciated.
Older versions of Chaquopy had a problem with pkgutil.iter_modules. This has been fixed in Chaquopy 6.2.1.

IO exception while creating file on android sdcard with permissions granted

I am trying to move file from internal phone memory to sd card.
val oldFile = File(oldPath) //oldPath is string
val newFile = File(newPath) //newPath is string
if(newFile.exists()) {
newFile.delete()
}
newFile.parentFile.mkdirs()
newFile.createNewFile() //crashes here
// copy file code
Paths are absolute.
Old file path is:
/storage/emulated/0/Android/data/com.package/files/2ec37ce3-ca72-4a35-a6e6-2d7f8e864c6c
New file path is:
/storage/48EE-C144/chosenDirectory/2ec37ce3-ca72-4a35-a6e6-2d7f8e864c6c
where 2ec37ce3-ca72-4a35-a6e6-2d7f8e864c6c is file.
Paths are proper and the new file path is chosen manually by user with external directory picker library which works fine.
Of course app asks user for permissions and does not shall pass user to app until permissions are not granted.
int perm = this.checkSelfPermission(permission.WRITE_EXTERNAL_STORAGE);
int perm2 = this.checkSelfPermission(permission.READ_EXTERNAL_STORAGE);
if (perm != PackageManager.PERMISSION_GRANTED || perm2 != PackageManager.PERMISSION_GRANTED) {
/*ask for permissions and show explain dialog*/
}
Parmissions in manifest are added too.
Application crashes while calling newFile.createNewFile() with exception log:
05-07 13:02:14.995 14004-14004/com.packagename E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.packagename, PID: 14004
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451) 
Caused by: java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:280)
at java.io.File.createNewFile(File.java:948)
at com.packagename.backend.localApi.changePath.PathChanger.changePath(PathChanger.kt:29)
at com.packagename.backend.localApi.changePath.PathChangeService$changePath$1.onSelect(PathChangeService.kt:49)
at com.codekidlabs.storagechooser.fragments.ChooserDialogFragment$1.onItemClick(ChooserDialogFragment.java:169)
at android.widget.AdapterView.performItemClick(AdapterView.java:343)
at android.widget.AbsListView.performItemClick(AbsListView.java:1665)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:4075)
at android.widget.AbsListView$10.run(AbsListView.java:6552)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6816)
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451) 
Need to add permission in AndroidManifest.xml file.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Solution for me was stop using java classes and migrate to Storage Access Framework

Categories

Resources