Tutorial AndLua+ - List of runtime errors

AndnixSH

PMT Elite Modder
Original poster
Staff member
Modding-Team
Jun 27, 2017
4,686
297,081
1,213
Modding World
List of runtime errors I discovered on AndLua+

* Android.os.Build$VERSION_CODES.M is not a field or method
Solution: Change Build.VERSION_CODES.M to 23

This only occur when using Android 5.1 and below

See more about SDK numbers: SDK Platform release notes | Android Developers

* android.view.WindowManager$LayoutParams.TYPE_APPLICATION_OVERLAY is not a field or method
TYPE_APPLICATION_OVERLAY is for Oreo and above. You should differentiate the target (before and after Oreo)

Code:
if Build.VERSION.SDK_INT >= 26 --Android 8.0 (API level 26)
  wmParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
  else
  wmParams.type = WindowManager.LayoutParams.TYPE_PHONE
end
* Unfinished string near "'(string)'
Solution: Put the quote at the end of the string

Missing end quote is caused by chinese character errors when using Android 5.1 and below