Signing problem with remote build on OS X Sierra with 1.3.0-beta

Hi,

I’m trying to remotebuild a simple libgdx project in eclipse from Windows 10 to OS X Sierra.

The build runs fine until signing.

export XCODE_APP_SUPPORT_DIR=/Applications/Xcode.app/Contents/Developer/Library/Xcode
export XCODE_PRODUCT_BUILD_VERSION=8B62
export XCODE_VERSION_ACTUAL=0810
export XCODE_VERSION_MAJOR=0800
export XCODE_VERSION_MINOR=0810
export XPCSERVICES_FOLDER_PATH=ios-moe.app/XPCServices
export YACC=yacc
export arch=arm64
export variant=normal
/bin/sh -c /var/folders/p0/57t2y8456zgf448z4ntg0j7h0000gn/T/tmp.8pgBYn0S/build/moe/xcodebuild/obj/ios-moe.build/Debug-iphoneos/ios-moe.build/Script-500AD4BF3AAD5E5D6382F974.sh
building file list ... done
created directory /var/folders/p0/57t2y8456zgf448z4ntg0j7h0000gn/T/tmp.8pgBYn0S/build/moe/xcodebuild/Debug-iphoneos/ios-moe.app/Frameworks
MOE.framework/
MOE.framework/Info.plist
MOE.framework/MOE

sent 26316155 bytes  received 70 bytes  17544150.00 bytes/sec
total size is 26312727  speedup is 1.00
SecKey API returned: -25308, (null)/var/folders/p0/57t2y8456zgf448z4ntg0j7h0000gn/T/tmp.8pgBYn0S/build/moe/xcodebuild/Debug-iphoneos/ios-moe.app/Frameworks/MOE.framework: unknown error -1=ffffffffffffffff
Command /bin/sh failed with exit code 1

** BUILD FAILED **


The following build commands failed:
PhaseScriptExecution Compile\ Sources\ (MOE) /var/folders/p0/57t2y8456zgf448z4ntg0j7h0000gn/T/tmp.8pgBYn0S/build/moe/xcodebuild/obj/ios-moe.build/Debug-iphoneos/ios-moe.build/Script-500AD4BF3AAD5E5D6382F974.sh
(1 failure)


:ios-moe:moeMainDebugIphoneosXcodeBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ios-moe:moeMainDebugIphoneosXcodeBuild'.
> Remote command execution failed

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 46.898 secs  

There seems to be a change in the management of the keychains. I hope, this post on StackOverflow will help fixing this bug.

security / codesign in Sierra: Keychain ignores access control settings and UI-prompts for permission

Dear stechi,

thank you for bringing this to our attention! In the mean time adding /usr/bin/codesign manually to your private key (using the keychain app or from terminal) might solve your issue.

Best Regards,
Kristóf

Thx for your reply, but codesign was allready added to the private key.
I also tryed to add trusting the certificate allways, but that also did not help.

Dear stechi,

We’ve updated the remote server configuration guide.

Executing this on the remote server should fix your issue:
(Assuming your keychain is moeremotebuild and the pass for it is devpass)

security set-key-partition-list -S apple-tool:,apple: -k devpass moeremotebuild.keychain

Best Regards,
Kristóf

Hi,

ok signing works now. But I have a new Problem.

It seams, the asset folder in the libgdx android module is not copied to the remote server.
If I copy the project to the remote server an run ./gradlew ios-moe:moeLaunch the app is build successfully. But on the local machine I get the following error.
What am I missing?

error: /var/folders/p0/57t2y8456zgf448z4ntg0j7h0000gn/T/android/assets: No such file or directory

** BUILD FAILED **


The following build commands failed:
 CpResource /var/folders/p0/57t2y8456zgf448z4ntg0j7h0000gn/T/android/assets /var/folders/p0/57t2y8456zgf448z4ntg0j7h0000gn/T/tmp.P1X77QvO/build/moe/xcodebuild/Release-iphoneos/ios-moe.app/assets
(1 failure)


:ios-moe:moeMainReleaseIphoneosXcodeBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ios-moe:moeMainReleaseIphoneosXcodeBuild'.
> Remote command execution failed

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Dear stechi,

this issue probably comes from a limitation of the remote build. Any file references which point outside of the MOE module will break the build. A quick and dirty solution to this would be to:

  • Create a Gradle Copy task which copies the resources from android/assets to ios-moe/build/a_directory_of_your_liking, preferably a directory which is not yes used
  • Make moeMainReleaseIphoneosXcodeBuild and moeMainDebugIphoneosXcodeBuild tasks depend on this copy task
  • Update the Xcode project so this the file reference points to the output of the copy task

Best Regards,
Kristóf

Hi,

thx for your help. Step by step it’s getting better :slight_smile:

I changed in xcode/ios.moe.xcodeproj/project.pbxproj the line

03E2841B1CDFA83B005BA4F0 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = ../../../android/assets; sourceTree = "<group>"; };

to

03E2841B1CDFA83B005BA4F0 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = ../../build/assets; sourceTree = "<group>"; };

and inserted this into build.gradle

task copyAssets(type: Copy) {
	from '../android/assets'
	into 'build/assets'
}
moeMainReleaseIphoneosXcodeBuild.dependsOn copyAssets
moeMainDebugIphoneosXcodeBuild.dependsOn copyAssets

and assets where found.

Next problem was

The following build commands failed:
      CompileC /var/folders/p0/57t2y8456zgf448z4ntg0j7h0000gn/T/tmp.fldavg5U/build/moe/xcodebuild/obj/ios-moe.build/Release-iphoneos/ios-moe.build/Objects-normal/armv7/..\\build\\moe\\main\\ui-headers\\moe-main-interfaces.o ..\\build\\moe\\main\\ui-headers\\moe-main-interfaces.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

After that error xcode/ios.moe.xcodeproj/project.pbxproj is modified. I Found 4 new lines in it. One of them has backslashes, which should be a problem on the remote system.

/* Begin PBXBuildFile section */
		853A3F59D7486634186E325E /* moe-main-interfaces.m in Sources */ = {isa = PBXBuildFile; fileRef = 16BDDA90E49ACD22A4E47438 /* moe-main-interfaces.m */; };
/* Begin PBXFileReference section */
		16BDDA90E49ACD22A4E47438 /* moe-main-interfaces.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "moe-main-interfaces.m"; path = "..\\build\\moe\\main\\ui-headers\\moe-main-interfaces.m"; sourceTree = "<group>"; };
/* Begin PBXGroup section */
		B67B1A970B7D10DF9268D4FB /* Multi-OS Engine */ = {
			children = (
				063E80B9F9F550B21E216832 /* moe-main-interfaces.m */,
				16BDDA90E49ACD22A4E47438 /* moe-main-interfaces.m */,
/* Begin PBXSourcesBuildPhase section */
		245921367BF4CB27ECA67B6F /* Sources */ = {
			files = (
				1C9DDC7B298906BDD21FF85C /* moe-main-interfaces.m in Sources */,
				853A3F59D7486634186E325E /* moe-main-interfaces.m in Sources */,

The funny thing: I was able to solve this by deleteing the new lines and start the build 1 or 2 times again.
This is reproduceable for me by cleaning the project before a build.

My main problem now is that after the app starts on the device I got this exception:

art E  1224 1624251 /Volumes/SSD/gh-moe-master-1.3.0-beta-1/aosp/art/runtime/java_vm_ext.cc:255] No implementation found for void com.badlogic.gdx.backends.iosrobovm.IOSGLES20.init() (tried Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init and Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init__)
java.lang.UnsatisfiedLinkError: No implementation found for void com.badlogic.gdx.backends.iosrobovm.IOSGLES20.init() (tried Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init and Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init__)
        at com.badlogic.gdx.backends.iosrobovm.IOSGLES20.init(Native Method)
        at com.badlogic.gdx.backends.iosrobovm.IOSGLES20.<init>(IOSGLES20.java:28)
        at com.badlogic.gdx.backends.iosmoe.IOSGraphics.init(IOSGraphics.java:118)
        at com.badlogic.gdx.backends.iosmoe.IOSApplication.didFinishLaunching(IOSApplication.java:162)
        at com.badlogic.gdx.backends.iosmoe.IOSApplication$Delegate.applicationDidFinishLaunchingWithOptions(IOSApplication.java:75)
        at apple.uikit.c.UIKit.UIApplicationMain(Native Method)
        at de.brettspielwelt.test3.IOSMoeLauncher.main(IOSMoeLauncher.java:24)

libgdx.a, libgdx-box2d.a and libObjectAL.a are located in xcode/native/ios/ but it seams that they aren’t included/copied to the device?
Direct compiling on the remote system still works.

Dear stechi,

the moe-main-interfaces.m issue is a known bug in 1.3.0-beta-1 and there is a fix for it in the upcoming 1.3.0-beta-2.
The java.lang.UnsatisfiedLinkError seems like a common libGDX + MOE 1.3 upgrade issue. Did you follow the instructions found here?

Best Regards,
Kristóf

Yes I had. But I’ve tried to build it with a fresh project created following your link. Just to be sure…

After Multi-OS Engine Actions > Inject/Refresh Xcode Project Settings I startet the app successfully on the Mac.

Running remotly:

build 1: problem with assets -> fixed with above solution
build 2: problem with moe-main-interfaces.m -> fixed with above solution
build 3: New Error:

Failed to delete file C:\Users\myusername\git\Test\ios-moe\build\moe\main\dex2oat\release-arm64\image.art

Fixed by deleteng file manually

build 4: got same error

java.lang.UnsatisfiedLinkError: No implementation found for void com.badlogic.gdx.backends.iosrobovm.IOSGLES20.init() (tried Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init and Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init__)

btw. the proguard.append.cfg becomes longer and longer by adding

-keep class com.badlogic.** { *; }
-keep enum com.badlogic.** { *; }

to the file every build

Tried it with 1.3.0-beta-2 but still no success.

Hi,

do you get the same error with beta-2, or a different error?

Best Regards,
Gergely

Well, in the first line is beta-2… :wink:

art E  1300 1826693 /Volumes/SSD/gh-moe-master-1.3.0-beta-2/aosp/art/runtime/java_vm_ext.cc:255] No implementation found for void com.badlogic.gdx.backends.iosrobovm.IOSGLES20.init() (tried Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init and Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init__)
java.lang.UnsatisfiedLinkError: No implementation found for void com.badlogic.gdx.backends.iosrobovm.IOSGLES20.init() (tried Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init and Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init__)
        at com.badlogic.gdx.backends.iosrobovm.IOSGLES20.init(Native Method)
        at com.badlogic.gdx.backends.iosrobovm.IOSGLES20.<init>(IOSGLES20.java:28)
        ...

Ok, this is not a signing issue, but looks like a linking issue. Did you upgrade the libgdx project for 1.3 beta 2? (Just use the “MOE Actions -> Inject / Refresh Xcode Project Settings” menu item.)
Can you share the failing project?

It’s the basic libgdx project created folowing the instructions from Kristófs Link