Sketchware-Pro / Sketchware-Pro

Sketchware Pro's sources in Java. Now anyone can contribute to Sketchware Pro.
https://sketchware.pro
Other
863 stars 254 forks source link

Java Complier Removes Some Methods From Classes ! #617

Closed arab-ware closed 10 months ago

arab-ware commented 1 year ago

Hello there , ! When I complie a java file with huge lines count , it deletes some statics methods, or even some normal methods , even when I use them (also proguard is not enabled so don't say please it is the problem) Screenshot_20221024-175938_Sketchware Pro Screenshot_20221024-175915_ArabWareFileManager

arab-ware commented 1 year ago

Note : I used code assist, same project , works

Arashvscode commented 1 year ago

Hello there , ! When I complie a java file with huge lines count , it deletes some statics methods, or even some normal methods , even when I use them (also proguard is not enabled so don't say please it is the problem) Screenshot_20221024-175938_Sketchware Pro Screenshot_20221024-175915_ArabWareFileManager

building in CodeAssist And MakeBlock in sk pro Tnks

arab-ware commented 1 year ago

What??

arab-ware commented 1 year ago

Hello there , ! When I complie a java file with huge lines count , it deletes some statics methods, or even some normal methods , even when I use them (also proguard is not enabled so don't say please it is the problem) Screenshot_20221024-175938_Sketchware Pro Screenshot_20221024-175915_ArabWareFileManager

building in CodeAssist And MakeBlock in sk pro Tnks

😐🙂did you understand what I mean. The complier fails when trying to compile my large java classes ... The complier should be changed to javac (same as code assist) It is more efficient

PranavPurwar commented 1 year ago

Can you try running the project again with minApi21 variant? It might be due to compiler update. If it still fails, send the .sketchware/debug.txt file here

arab-ware commented 1 year ago

Can you try running the project again with minApi21 variant? It might be due to compiler update. If it still fails, send the .sketchware/debug.txt file here

My Internet is weak , I could not download minApi21

By the way...I am sending debug log

arab-ware commented 1 year ago

2022-10-25T08:57:49.049+0300 D/AppBuilder: Running Eclipse compiler with these arguments: [-1.8, -nowarn, -deprecation, -d, /storage/emulated/0/.sketchware/mysc/767/bin/classes, -cp, /storage/emulated/0/.sketchware/mysc/767/bin/classes:/data/user/0/com.sketchware.remod/cache/libs/android.jar:/data/user/0/com.sketchware.remod/cache/libs/core-lambda-stubs.jar:/storage/emulated/0/.sketchware/libs/local_libs/FileWareUtilsArabWare/classes.jar:, -proc:none, /storage/emulated/0/.sketchware/mysc/767/app/src/main/java, /storage/emulated/0/.sketchware/mysc/767/gen, /storage/emulated/0/.sketchware/data/767/files/java] 2022-10-25T08:58:03.487+0300 D/AppBuilder: System.out of Eclipse compiler: 2022-10-25T08:58:03.498+0300 D/AppBuilder: System.err of Eclipse compiler: ----------

  1. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/MainActivity.java (at line 6) import android.app.DialogFragment; ^^^^^^^^^^^^^^^^^^^^^^^^^^ The type DialogFragment is deprecated , please use another class/method etc or change targetSdkVersion of your app to less one

  2. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/MainActivity.java (at line 7) import android.app.Fragment; ^^^^^^^^^^^^^^^^^^^^ The type Fragment is deprecated , please use another class/method etc or change targetSdkVersion of your app to less one

  3. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/MainActivity.java (at line 8) import android.app.FragmentManager; ^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type FragmentManager is deprecated , please use another class/method etc or change targetSdkVersion of your app to less one


  4. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/SketchwareUtil.java (at line 22) View _view = _toast.getView(); ^^^^^^^^^ The method getView() from the type Toast is deprecated

  5. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/SketchwareUtil.java (at line 31) _view.setBackgroundDrawable(_gradientDrawable); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The method setBackgroundDrawable(Drawable) from the type View is deprecated

  6. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/SketchwareUtil.java (at line 53) View _view = _toast.getView(); ^^^^^^^^^ The method getView() from the type Toast is deprecated

  7. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/SketchwareUtil.java (at line 64) _view.setBackgroundDrawable(_gradientDrawable); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The method setBackgroundDrawable(Drawable) from the type View is deprecated

  8. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/SketchwareUtil.java (at line 126) NetworkInfo _activeNetworkInfo = _connectivityManager.getActiveNetworkInfo(); ^^^^^^^^^^^ The type NetworkInfo is deprecated , please use another class/method etc or change targetSdkVersion of your app to less one

  9. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/SketchwareUtil.java (at line 126) NetworkInfo _activeNetworkInfo = _connectivityManager.getActiveNetworkInfo(); ^^^^^^^^^^^^^^^^^^^^^^ The method getActiveNetworkInfo() from the type ConnectivityManager is deprecated

  10. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/SketchwareUtil.java (at line 127) return _activeNetworkInfo != null && _activeNetworkInfo.isConnected(); ^^^^^^^^^^^^^ The method isConnected() from the type NetworkInfo is deprecated

  11. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/SketchwareUtil.java (at line 148) _inputMethodManager.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The method toggleSoftInput(int, int) from the type InputMethodManager is deprecated

  12. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/SketchwareUtil.java (at line 153) _inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The method toggleSoftInput(int, int) from the type InputMethodManager is deprecated

  13. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/SketchwareUtil.java (at line 153) _inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); ^^^^^^^^^^^ The field InputMethodManager.SHOW_FORCED is deprecated (please lower your targetSdkVersion or use another field.)


  14. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/HomeActivity.java (at line 6) import android.app.DialogFragment; ^^^^^^^^^^^^^^^^^^^^^^^^^^ The type DialogFragment is deprecated , please use another class/method etc or change targetSdkVersion of your app to less one

  15. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/HomeActivity.java (at line 7) import android.app.Fragment; ^^^^^^^^^^^^^^^^^^^^ The type Fragment is deprecated , please use another class/method etc or change targetSdkVersion of your app to less one

  16. WARNING in /storage/emulated/0/.sketchware/mysc/767/app/src/main/java/com/android/prime/arab/ware/everythingutils/HomeActivity.java (at line 8) import android.app.FragmentManager; ^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type FragmentManager is deprecated , please use another class/method etc or change targetSdkVersion of your app to less one


  17. WARNING in /storage/emulated/0/.sketchware/data/767/files/java/ScreenUtils.java (at line 53) activity.getWindowManager().getDefaultDisplay().getMetrics(outMetrics); ^^^^^^^^^^^^^^^^^^^ The method getDefaultDisplay() from the type WindowManager is deprecated

  18. WARNING in /storage/emulated/0/.sketchware/data/767/files/java/ScreenUtils.java (at line 53) activity.getWindowManager().getDefaultDisplay().getMetrics(outMetrics); ^^^^^^^^^^^^^^^^^^^^^^ The method getMetrics(DisplayMetrics) from the type Display is deprecated

  19. WARNING in /storage/emulated/0/.sketchware/data/767/files/java/ScreenUtils.java (at line 77) activity.getWindowManager().getDefaultDisplay().getMetrics(outMetrics); ^^^^^^^^^^^^^^^^^^^ The method getDefaultDisplay() from the type WindowManager is deprecated

  20. WARNING in /storage/emulated/0/.sketchware/data/767/files/java/ScreenUtils.java (at line 77) activity.getWindowManager().getDefaultDisplay().getMetrics(outMetrics); ^^^^^^^^^^^^^^^^^^^^^^ The method getMetrics(DisplayMetrics) from the type Display is deprecated

  21. WARNING in /storage/emulated/0/.sketchware/data/767/files/java/ScreenUtils.java (at line 125) window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); ^^^^^^^^^^^^^^^^^^^^^^^ The field WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS is deprecated (please lower your targetSdkVersion or use another field.)

    21 problems (21 warnings)

2022-10-25T08:58:03.721+0300 D/AppBuilder: Compiling Java files took 15599 ms 2022-10-25T08:58:15.344+0300 D/AppBuilder: D8 took 11563 ms 2022-10-25T08:58:15.384+0300 D/AppBuilder: Will merge these 2 DEX files to classes.dex: [/storage/emulated/0/.sketchware/libs/local_libs/FileWareUtilsArabWare/classes.dex, /storage/emulated/0/.sketchware/mysc/767/bin/dex/classes.dex] 2022-10-25T08:58:15.397+0300 D/AppBuilder: Skipped merging DEX files due to debug build with minSdkVersion >= 21 Packaging ArabWareFileManager.apk.unsigned /storage/emulated/0/.sketchware/mysc/767/bin/ArabWareFileManager.apk.res: => AndroidManifest.xml => res/drawable-xhdpi-v4/app_icon.png => res/drawable-xhdpi-v4/default_image.png => res/layout/home.xml => res/layout/main.xml => resources.arsc => assets/image.jpg /storage/emulated/0/.sketchware/libs/local_libs/FileWareUtilsArabWare/classes.dex => classes.dex /storage/emulated/0/.sketchware/libs/local_libs/FileWareUtilsArabWare/classes.jar: Native folder: /storage/emulated/0/.sketchware/data/767/files/native_libs /storage/emulated/0/.sketchware/mysc/767/bin/dex/classes.dex => classes2.dex 2022-10-25T08:58:18.214+0300 D/AppBuilder: Time passed since starting to compile resources until building the unsigned APK: 34892 ms

arab-ware commented 1 year ago

This Bug does not happen to smaller java classes It deletes some methods , I don't know why.

Javac ( code assist used complier ) works fine but I just suggest incase another one faces same problem

arab-ware commented 1 year ago

Screenshot_20221025-153810_Sketchware Pro Screenshot_20221025-153820_Sketchware Pro Screenshot_20221025-154131_ArabWareFileManager

arab-ware commented 1 year ago

@PranavPurwar @JavkhlanK All the methods are available and the complier does not show build error But after runtime...it shows me the methods does not exist I tried another class the same Another code and the same... Why ....please tell me if you could solve this issue in 05rc , Currently I am forced to use code assist which is a bit hard to code (especially when I exit and open it again , it refresh and I should wait :/💔)

arab-ware commented 1 year ago

I sent all screen shots & build.txt as text everything look fine...but runtime does not

Arashvscode commented 1 year ago

It is recommended to use version MinApi 21

Arashvscode commented 1 year ago

Screenshot_20221025-153810_Sketchware Pro Screenshot_20221025-153820_Sketchware Pro Screenshot_20221025-154131_ArabWareFileManager

This launcher is run time, pay attention to the errors, I have also encountered these simple errors, it is recommended to use the AndroidUtilCode library to create the library and respect the copyright.

JavkhlanK commented 1 year ago

Could you share the project or the Java source file that gets truncated somehow? Doesn't look like debug.txt is telling anything important.

arab-ware commented 1 year ago

Could you share the project or the Java source file that gets truncated somehow? Doesn't look like debug.txt is telling anything important.

https://github.com/abodinagdat16/EveryThingUtils/tree/master/EveryThingUtils/src/main/java/com/android/prime/arab/ware/everythingutils

arab-ware commented 1 year ago

So , did you guys try my java files? I shared a link , have a nice day , tell me result

JavkhlanK commented 1 year ago

I'll look at it now.

JavkhlanK commented 1 year ago

Maybe you had a wrong classpath and outdated source files set. I couldn't find those methods in source files in the GitHub repo you linked.

JavkhlanK commented 10 months ago

It doesn't look like any more info about the issue will be sent anytime soon, so I'll close this.

Please re-open this or a new Issue only with more details.