MobiVM / robovm

Ahead of time compiler for JVM bytecode targetting iOS, Mac OSX and Linux
https://mobivm.github.io
967 stars 133 forks source link

after build: LOCKDOWN_E_INVALID_HOST_ID #105

Closed MrCharli3 closed 7 years ago

MrCharli3 commented 7 years ago

I recently tried to replace the original RoboVm with Mobidevelop. I replaced all the dependencies as instructed, using mobidevelop robovm 2.2.0 (tried 2.3.0 as well, same issue). To be safe I re-made all my provisioning profiles etc. Since its been like 7 months since the last time I tried to test on an iOS device.

I can't instruct you in how to reproduce. I edited my run config to use the correct stuff, however I notice that it always checks "emulator" and not "device", nor is my iOS-device listed anywhere in Android Studio (but it is in Xcode). I press "run" at top of IDE.

I am trying to build on an iPhone 5 Version 10.2.1

Versions:

Please provide the version of RoboVM, XCode and JDK used

Stacktrace

[INFO] Compiling classes using 2 threads
[INFO] Compiled 0 classes in 13,25 seconds
[INFO] Linking 4561 classes (ios thumbv7 release)
[INFO] 47235 methods out of 47634 included in the executable
[INFO] Building ios binary /Users/Sandra/Desktop/AndroidStudioGame/ios/robovm-build/tmp/iOS Device/ios/thumbv7/IOSLauncher
[INFO] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o "/Users/Sandra/Desktop/AndroidStudioGame/ios/robovm-build/tmp/iOS Device/ios/thumbv7/IOSLauncher" -arch armv7 "-Wl,-filelist,/Users/Sandra/Desktop/AndroidStudioGame/ios/robovm-build/tmp/iOS Device/ios/thumbv7/objects0" -L /Users/Sandra/.robovm-sdks/robovm-1.14.0/lib/vm/ios/thumbv7 -ObjC -exported_symbols_list "/Users/Sandra/Desktop/AndroidStudioGame/ios/robovm-build/tmp/iOS Device/ios/thumbv7/exported_symbols" -Wl,-no_implicit_dylibs -Wl,-dead_strip -F/Users/Sandra/.robovm/cache/ios/thumbv7/release/cp/4f66b056ecec45cba87f52d9408f7689.extracted/META-INF/robovm/ios/libs -F/Users/Sandra/.robovm/cache/ios/thumbv7/release/cp/620550eae70d9fb66bf2640e93cfa8b9.extracted/META-INF/robovm/ios/libs -F/Users/Sandra/.robovm/cache/ios/thumbv7/release/cp/c517cd1334693c34b92b279dd537d7a5.extracted/META-INF/robovm/ios/libs -F/Users/Sandra/.robovm/cache/ios/thumbv7/release/cp/e290d819280b026f5408f7a9216fb05f.extracted/META-INF/robovm/ios/libs -F/Users/Sandra/.robovm/cache/ios/thumbv7/release/cp/9cf8f756edd43caedccfc58b78c09038.extracted/META-INF/robovm/ios/libs -fPIC -miphoneos-version-min=7.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk -lrobovm-bc -lrobovm-debug -lrobovm-core -lgc -lpthread -ldl -lm -lz -framework Foundation -framework FBSDKCoreKit -framework Bolts -framework AVFoundation -framework CoreGraphics -framework CoreMedia -framework CoreMotion -framework StoreKit -framework FBSDKLoginKit -framework FBSDKMessengerShareKit -framework FBSDKShareKit -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -framework AudioToolbox -force_load /Users/Sandra/.robovm/cache/ios/thumbv7/release/cp/dcb4bf31791a84f9cfb5a8098ab1eaf7.extracted/META-INF/robovm/ios/thumbv7/librobovm-rt-android.a -liconv -lsqlite3 -force_load /Users/Sandra/.robovm/cache/ios/thumbv7/release/cp/87cb51de537dd40fc060f46f4e01f6c1.extracted/META-INF/robovm/ios/libs/libgdx-freetype.a 
[INFO]     -force_load /Users/Sandra/.robovm/cache/ios/thumbv7/release/cp/3aba2d18b9add9eaca2972f68a4520fc.extracted/META-INF/robovm/ios/libs/libgdx.a -force_load /Users/Sandra/.robovm/cache/ios/thumbv7/release/cp/3aba2d18b9add9eaca2972f68a4520fc.extracted/META-INF/robovm/ios/libs/libObjectAL.a -lz -framework MobileCoreServices -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks
[INFO] Linked 4561 classes in 20,49 seconds
[INFO] Build done
[INFO] Launching executable
[ERROR] Couldn't start application
org.robovm.libimobiledevice.LibIMobileDeviceException: LOCKDOWN_E_INVALID_HOST_ID
    at org.robovm.libimobiledevice.LockdowndClient.checkResult(LockdowndClient.java:124)
    at org.robovm.libimobiledevice.LockdowndClient.<init>(LockdowndClient.java:48)
    at org.robovm.compiler.target.ios.AppleDeviceTarget.getDeviceInfo(AppleDeviceTarget.java:424)
    at org.robovm.compiler.target.ios.AppleDeviceTarget.getConnectedCompatibleDevices(AppleDeviceTarget.java:413)
    at org.robovm.idea.running.RoboVmRunProfileState.executeRun(RoboVmRunProfileState.java:55)
    at org.robovm.idea.running.RoboVmRunProfileState.startProcess(RoboVmRunProfileState.java:121)
    at com.intellij.execution.configurations.CommandLineState.execute(CommandLineState.java:80)
    at org.robovm.idea.running.RoboVmRunner.doExecute(RoboVmRunner.java:72)
    at com.intellij.execution.runners.GenericProgramRunner$1.execute(GenericProgramRunner.java:43)
    at com.intellij.execution.impl.ExecutionManagerImpl$5.run(ExecutionManagerImpl.java:389)
    at com.intellij.openapi.project.DumbServiceImpl.runWhenSmart(DumbServiceImpl.java:163)
    at com.intellij.execution.impl.ExecutionManagerImpl$4.run(ExecutionManagerImpl.java:346)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:857)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:658)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

If you need more information please let me know, will check as often as possible.

florianf commented 7 years ago

This issue was fixed in robovm 2.3.0, please try it with this Version. Edit: should also work in 2.2.0, like you said.Maybe you need to trust access from this mac again? "Trust this Computer" popup on the phone. Try running via gradle, maybe your idea plugin wasn't updated correctly, did you reinstall it from the fork's Plugin URL http://robovm.mobidevelop.com/downloads/releases/idea?

MrCharli3 commented 7 years ago

It is not device trust, that gives another error, something like "DIALOG_UNTRUST"-ish.

Changing to 2.3.0 did nothing for me. Here is my Gradle.Build:

`buildscript {
    repositories {
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        jcenter()
    }
    dependencies {
        classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0'
    }
}

allprojects {
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = '1.0'
    ext {
        appName = "SpaceFriends"
        gdxVersion = '1.9.2'
        roboVMVersion = '2.3.0'
        box2DLightsVersion = '1.4'
        ashleyVersion = '1.7.0'
        aiVersion = '1.8.0'
        gdxPayVersion = '0.10.3'
        gdxFacebookVersion = '1.2.2'
    }

    repositories {
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
    }
}
project(":desktop") {
    apply plugin: "java"

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
        compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
        compile "de.tomgrill.gdxfacebook:gdx-facebook-desktop:$gdxFacebookVersion"
    }
}
project(":android") {
    apply plugin: "android"

    android {
        compileSdkVersion 23
        buildToolsVersion '23.0.1'
    }

    configurations { natives }

    dependencies {
        compile project(":core")
        compile fileTree(dir: '../core/libs', include: '*.jar')
        compile('com.android.support:cardview-v7:23.2.0') {
            force = true
        }
        compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
        compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
        compile "de.tomgrill.gdxfacebook:gdx-facebook-android:$gdxFacebookVersion"
        compile "com.badlogicgames.gdxpay:gdx-pay-android:$gdxPayVersion"
        compile "com.badlogicgames.gdxpay:gdx-pay-android-googleplay:${gdxPayVersion}@aar"
    }
}
project(":ios") {
    apply plugin: "java"
    apply plugin: "robovm"

    dependencies {
        compile project(":core")
        compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
        compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
        compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
        compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
        compile "de.tomgrill.gdxfacebook:gdx-facebook-ios:$gdxFacebookVersion"
        compile "com.badlogicgames.gdxpay:gdx-pay-iosrobovm-apple:$gdxPayVersion"
    }
}
project(":html") {
    apply plugin: "gwt"
    apply plugin: "war"

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
        compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
        compile "de.tomgrill.gdxfacebook:gdx-facebook-html:$gdxFacebookVersion"
    }
}
project(":core") {
    apply plugin: "java"

    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
        compile "de.tomgrill.gdxfacebook:gdx-facebook-core:$gdxFacebookVersion"
        compile "com.badlogicgames.gdxpay:gdx-pay-client:$gdxPayVersion"
        compile fileTree(dir: "libs", include: "*.jar")
    }
}
tasks.eclipse.doLast {
    delete ".project"
}
`

Here is error from my event log:

`12:53:10 Compilation completed successfully in 32s 13ms
12:53:12 IllegalStateException: @NotNull method org/robovm/idea/running/RoboVmRunProfileState.startProcess must not return null
12:56:41 RuntimeException
         org.apache.commons.exec.ExecuteException: Command '/var/folders/0k/w0dq20l516j22jq5wnctch7r0000gn/T/ios-sim7501107188024142072 showdevicetypes' failed with output: 2017-02-18 12:56:40.911 ios-sim7501107188024142072[2967:70346] +[SimDeviceSet defaultSet]: unrecognized selector sent to class 0x1086485b8
         2017-02-18 12:56:40.913 ios-sim7501107188024142072[2967:70346] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[SimDeviceSet defaultSet]: unrecognized selector sent to class 0x1086485b8'
         *** First throw call stack:
         (
         0   CoreFoundation                      0x00007fff98b6a452 __exceptionPreprocess + 178
         1   libobjc.A.dylib                     0x00007fff9924f73c objc_exception_throw + 48
         2   CoreFoundation                      0x00007fff98bd400d +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
         3   CoreFoundation                      0x00007fff98ada4d1 ___forwarding___ + 1009
         4   CoreFoundation                      0x00007fff98ada058 _CF_forwar... (show balloon)
`

Here is my run config:

skarmavbild 2017-02-18 kl 12 57 50

I am still confused as to why Android Studio does not give any sort of reaction that A device is plugged in, like it does when you plug in an Android in your PC. Maybe that is intended? I don't know.

I am using the same plugin that I used for the "real" RoboVm, not sure if that is relevant. The only thing I changed was the cradle.build. (I have not downloaded anything manually, everything was done through gradle).

Tom-Ski commented 7 years ago

you should be using the latest version of the Intellij/AndroidStudio plugin for this RoboVM, on 2.3.0.

MrCharli3 commented 7 years ago

UPDATE:

I tried to reset my phone, and install the robovm plugin from disk instead (2.3.0). Now when my build is finished (100% finished) My entire Android Studio Crashes and shows this report:

PS: Is there no way to select my device in Android Studio? How do I know if AS is launching to an empty VM or to the connected device?

EDIT: If I run without the iphone device connected it still builds and crashes at the same point. I can see my device in Xcode (I can also run a test-project from xcode on the device) but not in AS. I have run adb kill-server/start-server and adb-devices which returns nothing, so I am thinking AS not recognising my device could be the issue. There is no info online for how to solve this on anything but a PC. Not sure where to go from here

florianf commented 7 years ago

It seems you're getting bitten by: https://github.com/MobiDevelop/robovm/issues/55

florianf commented 7 years ago

Closed as duplicate.

MrCharli3 commented 7 years ago

@florianf so... buy a new computer and phone? It used to work on the same comp/phone. and it works on simulator. It just seems AS doesnt recognise my device

florianf commented 7 years ago

Sorry, can't provide any more help than this. Either you get those openssl flags going as described in #55, or try to fix the issue by building your own openssl lib and linking that to your libimobiledevice.

MrCharli3 commented 7 years ago

@florianf Thanks for your help either way!

UwaisA commented 3 years ago

Maybe you need to trust access from this mac again? "Trust this Computer" popup on the phone. For people in future. This was the issue for me from @florianf 's answer. I updated my development device and that seems to reset the trusted computers. When I am writing this comment the process to trust a computer is to:

  1. Plug the device into a Mac
  2. Open Finder
  3. Navigate to the device
  4. Click trust on the Mac
  5. Click trust on the device