mazenrashed / Printooth

A well documented, high-level Android interface that makes printing via bluetooth printers easier
Mozilla Public License 2.0
396 stars 112 forks source link

Problem in scanning_activity.xml on SwipeRefreshLayout #107

Open bakirLakaf opened 1 year ago

bakirLakaf commented 1 year ago

When i try to pair to the printer i faced this my app has crashed and shows in Logcat : FATAL EXCEPTION: main Process: com.bakirdev.gestiondestock, PID: 7800 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bakirdev.gestiondestock/com.mazenrashed.printooth.ui.ScanningActivity}: android.view.InflateException: Binary XML file line #19 in com.bakirdev.gestiondestock:layout/activity_scanning: Binary XML file line #19 in com.bakirdev.gestiondestock:layout/activity_scanning: Error inflating class androidx.swiperefreshlayout.widget.SwipeRefreshLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3494) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3666) 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:2112) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:7889) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) Caused by: android.view.InflateException: Binary XML file line #19 in com.bakirdev.gestiondestock:layout/activity_scanning: Binary XML file line #19 in com.bakirdev.gestiondestock:layout/activity_scanning: Error inflating class androidx.swiperefreshlayout.widget.SwipeRefreshLayout Caused by: android.view.InflateException: Binary XML file line #19 in com.bakirdev.gestiondestock:layout/activity_scanning: Error inflating class androidx.swiperefreshlayout.widget.SwipeRefreshLayout Caused by: java.lang.ClassNotFoundException: androidx.swiperefreshlayout.widget.SwipeRefreshLayout at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:454) at android.view.LayoutInflater.createView(LayoutInflater.java:817) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1008) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:963) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1125) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1086) at android.view.LayoutInflater.inflate(LayoutInflater.java:684) at android.view.LayoutInflater.inflate(LayoutInflater.java:536) at android.view.LayoutInflater.inflate(LayoutInflater.java:479) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:775) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:197) at com.mazenrashed.printooth.ui.ScanningActivity.onCreate(ScanningActivity.kt:31) at android.app.Activity.performCreate(Activity.java:8109) at android.app.Activity.performCreate(Activity.java:8083) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3467) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3666) 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:2112) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:7889) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) 2023-02-15 13:27:30.576 7800-7800 AndroidRuntime com.bakirdev.gestiondestock E Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.swiperefreshlayout.widget.SwipeRefreshLayout" on path: DexPathList[[zip file "/data/app/~~mBcrfc3tcJUjgmG8S25m0A==/com.bakirdev.gestiondestock-cGunz14RVJ9c8vj3D_SEXw==/base.apk"],nativeLibraryDirectories=[/data/app/~~mBcrfc3tcJUjgmG8S25m0A==/com.bakirdev.gestiondestock-cGunz14RVJ9c8vj3D_SEXw==/lib/arm64, /data/app/~~mBcrfc3tcJUjgmG8S25m0A==/com.bakirdev.gestiondestock-cGunz14RVJ9c8vj3D_SEXw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) ... 28 more

Hoffera1 commented 1 year ago

I get this same error as well. It looks like that it needs it to be changed from "android" to "androidx" in layout/activity_scanning. Looks like there was a bug like this before and the issue was completed. I went back into the code and it is "android x", so why is there still an error?

Hoffera1 commented 1 year ago

I fixed the issue - all that needed to be done was add the dependency and all of it seems to work fine. I have a fork. https://github.com/Hoffera1/Printooth.git

IrvanWijayaSardam commented 1 year ago

hello , are you facing the same issue as i am ? https://github.com/mazenrashed/Printooth/issues/108#issue-1598176099