Libgdx Dispose Sprite Batch Error - libgdx

I wants to dispose a batch in my game screen. However, after i dispose, the second time i enter my game screen, error occurs which only shows the following:
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000779ae303, pid=4816, tid=5000
#
# JRE version: Java(TM) SE Runtime Environment (8.0_73-b02) (build 1.8.0_73-b02)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.73-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [ntdll.dll+0x4e303]
My coding flow goes like this
new Main Menu screen ->>
Game Screen (screen created by (Game)Gdx.app.getApplicationListener()).setScreen(new GameScreen(mainScreenReference),new Sprite Batch created, a reference of Main Menu Screen is passed to Game screen)->>
(After game over, in the Game Screen hide method, batch is disposed)->>
back to Main Menu Screen ->> (play again by entering into new Game Screen) ->>
ERROR
This isn't due to duplicated dispose. Everything works well if sprite batch in game screen is not disposed. Anyone please help.

Related

not able to debug play framework 2.6.x application in Scala IDE

I am new to Play, I have installed SBT 1.0.2, Scala IDE 4.6.1, from play documentation downloaded play-scala-starter-example project, i want to debug the project, i did following things.
set environment variables SBT_OPTS to -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
tried to run the project with "sbt -jvm-debug 9999 run" but it gives "Not a valid command: jvm-debug"
ran it with "sbt run" and in Scala IDE, i created following configuration,
and added breakpoints in HomeController of sample project, but when i refresh the page running on port 9000 doesnt stop, and when i use "Scala Debugger (Socket Attach) it gives error "Failed to connect to remote VM. Connection timed out." Scala IDE Configuration
I was having trouble setting the enviroment on windows 10 play 2.6, the way I found for play to start listen to the debug port was adding in projectfolder\sbt-dist\conf\sbtconfig , after #Set the extra SBT options:
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
though it will open socket every time you run sbt
1) Add sbt eclipse plugin in you project.sbt
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.2")
2) Set the environment as for debugging follow
set SBT_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5555
sbt run
3) Attache debugger to remote application in eclipse as
i) In Eclipse, right-click your project, then choose Debug As -> Debug Configurations...
ii) Right-click Remote Java Application, then click New.
The host should already be set to localhost. Set the port to 5555 (the default port used by the play debug run command).
iii)Click Apply to save, then Debug to connect to your running Play instance

LIBGDX ios simulator crash. LibGDX / Robovm compiles for 64bit instead of 32bit. What should I do?

My libgdx app starts up on ios simulator and shows ios intro libgdx pic, then crashes.
I get:
[ERROR] Session could not be started: Error Domain=NSPOSIXErrorDomain Code=3 "Unable to run app in Simulator" UserInfo=0x7f853960ff60 {NSUnderlyingError=0x7f8539464ff0 "Failed to lookup the process ID of se.myapp.IOSLauncher after successful launch. Perhaps it crashed after launch.", NSLocalizedFailureReason=An error was encountered while running (Domain = NSPOSIXErrorDomain, Code = 3), NSLocalizedDescription=Unable to run app in Simulator}
Seems to be related to trying to run 64bit on iPhone 4s, where it is not supported. Does anyone know how to turn off 64bit for robovm in libgdx?
If I change the ios-sim command:
/Users/macuser/Documents/workspace/.metadata/.plugins/org.robovm.eclipse.ui/robovm-1.4.0/bin/ios-sim launch /Users/macuser/Documents/workspace/.metadata/.plugins/org.robovm.eclipse.ui/build/myapp-ios/myapp-ios/ios/x86_64/IOSLauncher.app --timeout 90 --unbuffered --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-4s, 8.0" --stdout /var/folders/ml/zdhkbw3x0g9550pq9mgfrcsw0000gn/T/robovm-stdout-6250612031367207111.fifo --stderr /var/folders/ml/zdhkbw3x0g9550pq9mgfrcsw0000gn/T/robovm-stderr-5592986297298678222.fifo --setenv ROBOVM_LAUNCH_MODE=release --args -rvm:log=warn
To:
/Users/macuser/Documents/workspace/.metadata/.plugins/org.robovm.eclipse.ui/robovm-1.4.0/bin/ios-sim launch /Users/macuser/Documents/workspace/.metadata/.plugins/org.robovm.eclipse.ui/build/myapp-ios/myapp-ios/ios/x86/IOSLauncher.app --timeout 90 --unbuffered --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-4s, 8.0" --stdout /var/folders/ml/zdhkbw3x0g9550pq9mgfrcsw0000gn/T/robovm-stdout-6250612031367207111.fifo --stderr /var/folders/ml/zdhkbw3x0g9550pq9mgfrcsw0000gn/T/robovm-stderr-5592986297298678222.fifo --setenv ROBOVM_LAUNCH_MODE=release --args -rvm:log=warn
It works with the old robovm. But for the new version it seems those directories aren't even built at all, so it fails.
Where should I specify the architecture? There is:
<arch>thumbv7</arch>
in robovm.xml but it doesn't seem to do anything?
Has this anything to do with the eclipse integration plugin (I am running from eclipse)?
OK I found out (after about 12 hours of digging)!
I looked in the wrong place all the time. The solution is (in eclipse) to go to Run Configurations / iOS Simulator App / Choose a device and select 32-bit (x86).

abobe air 3.8 NativeProcess.isSupported issue # startup windows

(first-post)
i am having a problem with NativeProcess.isSupported.
its a simple app make in abobe flash publish in air 3.8 .exe. everything works great :)
< supportedProfiles> desktop extendedDesktop tv extendedTV < /supportedProfilessetup.>
NativeApplication.nativeApplication.startAtLogin = true //after install, app start auto with win
NativeProcess.isSupported
var file: File = File.applicationDirectory.resolvePath("PC_shutdown.exe") //after timer the pc shutdown
install the setup.exe file run in windows 8, thats work 100% of the time. (manual start)
as in code the app start with windows login (its work) but NativeProcess.isSupported is then false so shutdown.exe will not executed. but when i manual start the app NativeProcess.isSupported is true and .exe is executed.
first run is false > close app > restart then it's true??? i have no idea/logic.
thx
NativeProcess support only works when you package your AIR application as a bundle (i.e. you create a self contained application with a copy of Adobe Air). This is done by specifying the "-target bundle" flag OR "-target native" flag when running adt.
More info on adt bundle/native installer flags

MIPS GCC compiling wrong MIPS release?

I'm looking to plunge into the realm of router hacking. Currently, I'm just trying to get a simple hello world to run on my router, a F7D7302 v1, running dd-wrt. cpuinfo reveals a BCM4716, and "MIPS 74K V4.0" as the cpu 'model.'
I downloaded CodeSourcery's MIPS cross-compiler. It was pretty simple to get a compiled executable from that point on. I transferred the file, chmod +x'd the file, and it didn't run.
I decided to do a big of snooping and ran 'file' on the router's busybox executable:
[root#LIENUX bin]# file /tmp/busybox
/tmp/busybox: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked (uses shared libs), corrupted section header size
And running 'file' on my hello world:
[root#LIENUX bin]# file test
test: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), for GNU/Linux 2.6.16, with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x1040000, not stripped
Running test on the router with static libraries caused a 100% CPU hang; running with dynamic libraries caused a 'not found' error. All appropriate permissions were set.
Anyone know what I am doing wrong?

Native Context not available using Leapmotion AS3 ANE file

I´m getting this error while trying to compile a Flashdevelop AIR project:
Native Context not available. The Config class is only available in Adobe AIR.
My setup:
Using Starling.
Using the ANE file from https://github.com/logotype/LeapMotionAS3
Using Flex SDK 4.6.0/AIR 3.8 in Flashdevelop 4.4.4 RTM
Extended Desktop profile is on.
The error fires up when I try to use the controller.config() or screen.* as in:
if(leap.config().setFloat("Gesture.Swipe.MinLength", 200.0) && leap.config().setFloat("Gesture.Swipe.MinVelocity", 500)) leap.config().save();
My onConnect();
private function alConectar(event:LeapEvent):void{
trace("conectado");
leap.enableGesture(Gesture.TYPE_SWIPE);
leap.enableGesture(Gesture.TYPE_SCREEN_TAP);
if(leap.config().setFloat("Gesture.Swipe.MinLength", 200.0) && leap.config().setFloat("Gesture.Swipe.MinVelocity", 500)) leap.config().save();
if(leap.config().setFloat("Gesture.ScreenTap.MinForwardVelocity", 30.0) && leap.config().setFloat("Gesture.ScreenTap.HistorySeconds", .5) && leap.config().setFloat("Gesture.ScreenTap.MinDistance", 1.0)) leap.config().save();
//etc...
}
The full output:
Running process: C:\Program Files\FlashDevelop\Tools\fdbuild\fdbuild.exe "C:\Users\CASA\Documents\00_INTERACTIVE\LEAP\Leap_AirAS3Proj\Leap_AirAS3Proj.as3proj" -ipc 8b4c615f-60f6-46ac-aec0-093781073835 -version "3.8.0" -compiler "C:\Program Files\FlashDevelop\Tools\ascsdk" -library "C:\Program Files\FlashDevelop\Library"
Building Leap_AirAS3Proj
mxmlc-cli -load-config="C:\Program Files\FlashDevelop\Tools\ascsdk/frameworks/air-config.xml" -load-config+=obj\Leap_AirAS3ProjConfig.xml -debug=true -inline=true +configname=air -swf-version=21 -o obj\Leap_AirAS3Proj635190875306772137
Running java as: java.exe
Loading configuration: C:\Program Files\FlashDevelop\Tools\ascsdk\frameworks\air-config.xml
Loading configuration: C:\Users\CASA\Documents\00_INTERACTIVE\LEAP\Leap_AirAS3Proj\obj\Leap_AirAS3ProjConfig.xml
206311 bytes written to C:\Users\CASA\Documents\00_INTERACTIVE\LEAP\Leap_AirAS3Proj\obj\Leap_AirAS3Proj635190875306772137 in 6.156 seconds
Build succeeded
Done(0)
[Starting debug session with FDB]
[Starling] Initialization complete.
[Starling] Display Driver: DirectX9 (Baseline Constrained)
init
conectado
[Fault] exception, information=Error: Native Context not available. The Config class is only available in Adobe AIR.
Already change the bat/SetupSDK to: set FLEX_SDK=C:\Program Files\FlashDevelop\Tools\ascsdk to reflect the SDK (Thanks to Philippe from Flashdevelop).
Any help is welcome.
Regards!