AndroidIDEOfficial / AndroidIDE

AndroidIDE is an IDE for Android to develop full featured Android apps.
https://m.androidide.com
GNU General Public License v3.0
2.35k stars 291 forks source link

EditorPagerAdpater crashes when trying to close a file #43

Closed Premjit-Developer closed 2 years ago

Premjit-Developer commented 2 years ago

Describe the bug When i try use terminal and update the sysroot/ lib after 3--4 attempts it crashes.

Details (please complete the following information): Manufacturer: Xiaomi Device: M2102J20SI App version: 2.0-beta (200) Additional context

Stacktrace: 
java.lang.NullPointerException: Attempt to invoke virtual method 'void io.github.rosemoe.editor.widget.CodeEditor.close()' on a null object reference
    at com.itsaky.androidide.adapters.EditorPagerAdapter.closeFileAt(EditorPagerAdapter.java:132)
    at com.itsaky.androidide.adapters.EditorPagerAdapter.closeAllFiles(EditorPagerAdapter.java:147)
    at com.itsaky.androidide.EditorActivity.closeAll(EditorActivity.java:903)
    at com.itsaky.androidide.EditorActivity.closeProject(EditorActivity.java:1075)
    at com.itsaky.androidide.EditorActivity.lambda$confirmProjectClose$15$com-itsaky-androidide-EditorActivity(EditorActivity.java:1095)
    at com.itsaky.androidide.EditorActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:2)
    at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:236)
    at android.app.ActivityThread.main(ActivityThread.java:8056)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
itsaky commented 2 years ago

Looking at the stack trace, I can confirm that it is not related with Terminal.

This is happening because I migrated to ViewPager2 (and failed to implement it properly). I'll fix it soon.

itsaky commented 2 years ago

Hey @Premjit-Chowdhury, could you please check again if it works with the changes in the latest commit?

Premjit-Developer commented 2 years ago

Sorry for late reply. As for now im getting this error 👇 Screenshot_2022-01-08-05-21-23-895_ru zdevs zarchiver Downloaded it 2times but same problem ,so after after downloading it properly i will check.

Premjit-Developer commented 2 years ago

Hey @Premjit-Chowdhury, could you please check again if it works with the changes in the latest commit?

Not faced any issues till now.