sayyam / instagramapi

A wrapper on instagram api for android
74 stars 15 forks source link

App is getting crashed on any button click #13

Open sallu1001 opened 6 years ago

sallu1001 commented 6 years ago

Hello, I'm facing this issue of App crash whenever I click on any of the button. I find this lib very useful but unable to access the functionality, Kindly help me with it. Following is the stack trace for the crash -

09-11 12:43:31.534 29802-29802/com.instagram.instagramapi.sample E/AndroidRuntime: FATAL EXCEPTION: main Process: com.instagram.instagramapi.sample, PID: 29802 java.lang.IllegalStateException: Could not execute method for android:onClick at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:389) at android.view.View.performClick(View.java:6303) at android.view.View$PerformClick.run(View.java:24828) 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:6798) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384) at android.view.View.performClick(View.java:6303)  at android.view.View$PerformClick.run(View.java:24828)  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:6798)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)  Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/logging/HttpLoggingInterceptor; at com.instagram.instagramapi.engine.InstagramEngine.(InstagramEngine.java:87) at com.instagram.instagramapi.engine.InstagramEngine.getInstance(InstagramEngine.java:134) at com.instagram.instagramapi.sample.SampleActivity.genericClickListener(SampleActivity.java:271) at java.lang.reflect.Method.invoke(Native Method)  at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384)  at android.view.View.performClick(View.java:6303)  at android.view.View$PerformClick.run(View.java:24828)  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:6798)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)  Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.logging.HttpLoggingInterceptor" on path: DexPathList[[zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/base.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_dependencies_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_resources_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_0_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_1_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_2_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_3_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_4_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_5_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_6_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_7_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_8_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/lib/arm64, /system/lib64, /system/vendor/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.instagram.instagramapi.engine.InstagramEngine.(InstagramEngine.java:87)  at com.instagram.instagramapi.engine.InstagramEngine.getInstance(InstagramEngine.java:134)  at com.instagram.instagramapi.sample.SampleActivity.genericClickListener(SampleActivity.java:271)  at java.lang.reflect.Method.invoke(Native Method)  at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384)  at android.view.View.performClick(View.java:6303)  at android.view.View$PerformClick.run(View.java:24828)  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:6798)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)  Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_resources_apk.apk at dalvik.system.DexFile.openDexFileNative(Native Method) at dalvik.system.DexFile.openDexFile(DexFile.java:353) at dalvik.system.DexFile.(DexFile.java:100) at dalvik.system.DexFile.(DexFile.java:74) at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374) at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337) at dalvik.system.DexPathList.(DexPathList.java:157) at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:65) at dalvik.system.PathClassLoader.(PathClassLoader.java:64) 09-11 12:43:31.535 29802-29802/com.instagram.instagramapi.sample E/AndroidRuntime: at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:36) at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:686) at android.app.LoadedApk.getClassLoader(LoadedApk.java:719) at android.app.LoadedApk.getResources(LoadedApk.java:947) at android.app.ContextImpl.createAppContext(ContextImpl.java:2290) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5904) at android.app.ActivityThread.-wrap1(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1756) at android.os.Handler.dispatchMessage(Handler.java:105) ... 5 more 09-11 12:43:31.538 29802-29802/com.instagram.instagramapi.sample E/AndroidRuntime: FATAL EXCEPTION: main Process: com.instagram.instagramapi.sample, PID: 29802 java.lang.IllegalStateException: Could not execute method for android:onClick at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:389) at android.view.View.performClick(View.java:6303) at android.view.View$PerformClick.run(View.java:24828) 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:6798) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384) at android.view.View.performClick(View.java:6303)  at android.view.View$PerformClick.run(View.java:24828)  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:6798)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)  Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/logging/HttpLoggingInterceptor; at com.instagram.instagramapi.engine.InstagramEngine.(InstagramEngine.java:87) at com.instagram.instagramapi.engine.InstagramEngine.getInstance(InstagramEngine.java:134) at com.instagram.instagramapi.sample.SampleActivity.genericClickListener(SampleActivity.java:271) at java.lang.reflect.Method.invoke(Native Method)  at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384)  at android.view.View.performClick(View.java:6303)  at android.view.View$PerformClick.run(View.java:24828)  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:6798)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)  Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.logging.HttpLoggingInterceptor" on path: DexPathList[[zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/base.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_dependencies_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_resources_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_0_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_1_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_2_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_3_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_4_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_5_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_6_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_7_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_8_apk.apk", zip file "/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/lib/arm64, /system/lib64, /system/vendor/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.instagram.instagramapi.engine.InstagramEngine.(InstagramEngine.java:87)  at com.instagram.instagramapi.engine.InstagramEngine.getInstance(InstagramEngine.java:134)  at com.instagram.instagramapi.sample.SampleActivity.genericClickListener(SampleActivity.java:271)  at java.lang.reflect.Method.invoke(Native Method)  at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384)  at android.view.View.performClick(View.java:6303)  at android.view.View$PerformClick.run(View.java:24828)  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:6798)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)  Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.instagram.instagramapi.sample-O9N8aapKX1x8P1R1XeneOw==/split_lib_resources_apk.apk at dalvik.system.DexFile.openDexFileNative(Native Method) at dalvik.system.DexFile.openDexFile(DexFile.java:353) at dalvik.system.DexFile.(DexFile.java:100) at dalvik.system.DexFile.(DexFile.java:74) at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374) at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337) at dalvik.system.DexPathList.(DexPathList.java:157) at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:65) at dalvik.system.PathClassLoader.(PathClassLoader.java:64) 09-11 12:43:31.538 29802-29802/com.instagram.instagramapi.sample E/AndroidRuntime: at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:36) at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:686) at android.app.LoadedApk.getClassLoader(LoadedApk.java:719) at android.app.LoadedApk.getResources(LoadedApk.java:947) at android.app.ContextImpl.createAppContext(ContextImpl.java:2290) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5904) at android.app.ActivityThread.-wrap1(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1756) at android.os.Handler.dispatchMessage(Handler.java:105) ... 5 more

mirulumam commented 6 years ago

Hello, I'm facing this issue of App crash whenever I click on any of the button. I find this lib very useful but unable to access the functionality, Kindly help me with it. Following is the stack trace for the crash -

@sallu1001

i have same issue. fixed by adding these into app's gradle file:

implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'

maybe author will fixed it in next version, or i did a mistake when installing this library

sallu1001 commented 6 years ago

@mirulumam Thanks for the update. Cheers!

qadirsuh commented 4 years ago

Hello, I'm facing this issue of App crash whenever I click on any of the button. I find this lib very useful but unable to access the functionality, Kindly help me with it. Following is the stack trace for the crash -

@sallu1001

i have same issue. fixed by adding these into app's gradle file:

implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'

maybe author will fixed it in next version, or i did a mistake when installing this library

I downloaded the latest code which contains your answer implementations of libs, but app is still crashing at my side.