roboscala / sbt-robovm

An sbt plugin for iOS development in Scala
BSD 2-Clause "Simplified" License
108 stars 16 forks source link

IDEVICE_E_UNKONWN_ERROR #60

Closed darkfrog26 closed 8 years ago

darkfrog26 commented 8 years ago

I'm getting the following stacktrace when I try to run "debug:device" on my iPod Touch:

2015-12-31 08:52:56.583 gotadawul[374:405027] [debug] IOSApplication: iOS version: 9.2
2015-12-31 08:52:56.586 gotadawul[374:405027] [debug] IOSApplication: Running in 32-bit mode
2015-12-31 08:52:56.616 gotadawul[374:405027] [debug] IOSApplication: scale: 2.0
2015-12-31 08:52:56.693 gotadawul[374:405027] [debug] IOSApplication: Unscaled View: LandscapeLeft 480x300
2015-12-31 08:52:56.694 gotadawul[374:405027] [debug] IOSApplication: View: LandscapeLeft 960x600
2015-12-31 08:52:56.705 gotadawul[374:405027] [debug] IOSGraphics: 960.0x600.0, 2.0
2015-12-31 08:52:57.562 gotadawul[374:405027] [debug] IOSGraphics: Display: ppi=326, density=2.0375
2015-12-31 08:52:58.348 gotadawul[374:405027] [debug] IOSApplication: created
2015-12-31 08:52:58.353 gotadawul[374:405027] [debug] IOSApplication: resumed
java.lang.UnsatisfiedLinkError: com.badlogic.gdx.backends.iosrobovm.IOSGLES20.glViewportJni(IIII)V
    at com.badlogic.gdx.backends.iosrobovm.IOSGLES20.glViewportJni(Native Method)
    at com.badlogic.gdx.backends.iosrobovm.IOSGLES20.glViewport(IOSGLES20.java:365)
    at com.badlogic.gdx.backends.iosrobovm.IOSGraphics.draw(IOSGraphics.java:296)
    at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.draw(IOSGraphics.java:201)
    at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.$cb$drawRect$(IOSGraphics.java)
    at org.robovm.apple.uikit.UIApplication.main(Native Method)
    at org.robovm.apple.uikit.UIApplication.main(UIApplication.java:395)
    at com.gotadawul.mobile.Main$.main(Main.scala:17)
    at com.gotadawul.mobile.Main.main(Main.scala)
java.io.IOException: org.robovm.libimobiledevice.LibIMobileDeviceException: IDEVICE_E_UNKNOWN_ERROR
    at org.robovm.libimobiledevice.IDeviceConnection$DeviceInputStream.read(IDeviceConnection.java:202)
    at com.robovm.debug.server.d.k.a(Unknown.java:922)
    at com.robovm.debug.server.d.k.a(Unknown.java:901)
    at com.robovm.debug.server.d.d.run(Unknown.java:622)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.robovm.libimobiledevice.LibIMobileDeviceException: IDEVICE_E_UNKNOWN_ERROR
    at org.robovm.libimobiledevice.IDevice.checkResult(IDevice.java:196)
    at org.robovm.libimobiledevice.IDeviceConnection.receive(IDeviceConnection.java:109)
    at org.robovm.libimobiledevice.IDeviceConnection.receive(IDeviceConnection.java:80)
    at org.robovm.libimobiledevice.IDeviceConnection$DeviceInputStream.read(IDeviceConnection.java:200)
    ... 4 more

I'm not positive this is a sbt-robovm issue, a RoboVM issue, or something I'm doing wrong, but I assumed this was the place to start.

Darkyenus commented 8 years ago

I am not sure that your error is because of the version, but try sbt-robovm 1.12 locally (see readme: Hacking on the plugin) and see for yourself. If you haven't already, try clean build and check that your XCode is updated.

Otherwise, more information will be needed for reproducing.

darkfrog26 commented 8 years ago

I attempted to switch to 1.12.0 but got the following error:

ld: -no_pie and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Darkyenus commented 8 years ago

I am not entirely sure what is going on here, but try disabling bitcode generation (robovmBitcode := false, you can scope it to the device task).

darkfrog26 commented 8 years ago

Okay, you were right, I'm getting the IDEVICE_E_UNKNOWN_ERROR even when running 1.12.0.

Any other ideas of things I can try?

Darkyenus commented 8 years ago

Does it work in non-debug mode/on simulator? What is your setup, device, project, etc.? Creating SSCCE would help.

darkfrog26 commented 8 years ago

Unfortunately I've been unable to get it to work on the simulator either. I have been trying to run it in debug in order to see what the actual error is.

darkfrog26 commented 8 years ago

I just attempted to run iphoneSim with 1.12.0 and got the following:

[debug] Setting OS to ios
[debug] Written LastRobovm.xml (for debug)
[info] Compiling RoboVM app, this could take a while
[info] RoboVM app compiled
java.lang.ArrayIndexOutOfBoundsException: 1
    at org.robovm.compiler.target.ios.DeviceType.listDeviceTypes(DeviceType.java:131)
    at org.robovm.compiler.target.ios.DeviceType.getBestDeviceType(DeviceType.java:253)
    at org.robovm.compiler.target.ios.DeviceType.getBestDeviceType(DeviceType.java:221)
    at sbtrobovm.RobovmProjects$$anonfun$iOSProjectSettings$11.apply(RobovmProjects.scala:358)
    at sbtrobovm.RobovmProjects$$anonfun$iOSProjectSettings$11.apply(RobovmProjects.scala:358)
    at sbtrobovm.RobovmProjects$$anonfun$simulatorTask$1.apply(RobovmProjects.scala:335)
    at sbtrobovm.RobovmProjects$$anonfun$simulatorTask$1.apply(RobovmProjects.scala:334)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (ios/*:iphoneSim) java.lang.ArrayIndexOutOfBoundsException: 1
darkfrog26 commented 8 years ago

@Darkyenus, I'm about to the point of just creating a simple app just to verify the flow, but was hoping to avoid having to create a completely new project just for testing.

Darkyenus commented 8 years ago

Try to add and execute this task in your build.sbt:

TaskKey[Unit]("listDeviceTypes") := {
  println("Found devices:\n"+new org.robovm.compiler.util.Executor(org.robovm.compiler.log.Logger.NULL_LOGGER, org.robovm.compiler.target.ios.AppleDeviceTarget.getIosSimPath()).args("showdevicetypes").execCapture())
}

That stacktrace suggests that it returns malformed output on your setup. For example for me it returns:

com.apple.CoreSimulator.SimDeviceType.iPhone-4s, 9.2, (i386)
com.apple.CoreSimulator.SimDeviceType.iPhone-5, 9.2, (i386)
com.apple.CoreSimulator.SimDeviceType.iPhone-5s, 9.2, (x86_64 i386)
com.apple.CoreSimulator.SimDeviceType.iPhone-6, 9.2, (x86_64 i386)
com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus, 9.2, (x86_64 i386)
com.apple.CoreSimulator.SimDeviceType.iPhone-6s, 9.2, (x86_64 i386)
com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus, 9.2, (x86_64 i386)
com.apple.CoreSimulator.SimDeviceType.iPad-2, 9.2, (i386)
com.apple.CoreSimulator.SimDeviceType.iPad-Retina, 9.2, (i386)
com.apple.CoreSimulator.SimDeviceType.iPad-Air, 9.2, (x86_64 i386)
com.apple.CoreSimulator.SimDeviceType.iPad-Air-2, 9.2, (x86_64 i386)
com.apple.CoreSimulator.SimDeviceType.iPad-Pro, 9.2, (x86_64 i386)
com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p, 9.1, (x86_64)
com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm, 2.1, (i386)
com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm, 2.1, (i386)

(That task's code is based on what DeviceType.listDeviceTypes() has (It is RoboVM internal class))

darkfrog26 commented 8 years ago

I'm getting the exact same output that you are there.

Darkyenus commented 8 years ago

Can't reproduce. If anybody encounters this again, please reopen.