Building thumbv7:arm64 from the command line fails with beta03

777 views
Skip to first unread message

Bucky Beaver

unread,
Jan 19, 2015, 9:12:51 AM1/19/15
to rob...@googlegroups.com
I've upgraded from libgdx 1.5.2 to 1.5.3 and RoboVm from beta02 to beta03.

Previously I've always built from the command line using

./gradlew ios:createIPA -debug --stacktrace


to build my ipa (I assume this was the correct thing to do - I include debug and stacktrace so I can see when I get errors).

I tried to build the 64 bit as well as 32 bit so tried:


./gradlew -Probovm.ipaArchs=thumbv7:arm64 ios:createIPA -debug --stacktrace


but this fails. It does all the compiling and linking but then fails with hundreds of lines similar to:


11:31:58.456 [ERROR] [org.gradle.api.Task] duplicate symbol _OBJC_METACLASS_$_GADAdSizeWrapped in:

11:31:58.457 [ERROR] [org.gradle.api.Task]     <...directory path...> /ios/libs/admob-1.0.0-beta-01.jar.extracted/META-INF/robovm/ios/libs/libadmob.a(GADAdSizeWrapped.o)


It then ends with:

14:11:41.300 [ERROR] [org.gradle.api.Task] ld: 918 duplicate symbols for architecture arm64

14:11:41.337 [ERROR] [org.gradle.api.Task] clang: error: linker command failed with exit code 1 (use -v to see invocation)

14:11:41.340 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':ios:createIPA'


Niklas Therning

unread,
Jan 19, 2015, 10:36:48 AM1/19/15
to Bucky Beaver, rob...@googlegroups.com
Please post the clang++ line from your log for both the architectures. Could be that some lib/framework gets linked in twice for some reason.

--
You received this message because you are subscribed to the Google Groups "RoboVM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robovm+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bucky Beaver

unread,
Jan 19, 2015, 11:35:26 AM1/19/15
to rob...@googlegroups.com, buckybe...@gmail.com
Interesting ... here is the clang for the armv7 that worked:

14:07:45.422 [DEBUG] [org.gradle.api.Task] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o /data/myWorkspace/myGame/ios/build/robovm.tmp/thumbv7/myGame -arch armv7 -Wl,-filelist,/data/myWorkspace/myGame/ios/build/robovm.tmp/thumbv7/objects -L /Users/myUserid/.m2/repository/org/robovm/robovm-dist/1.0.0-beta-03/unpacked/robovm-1.0.0-beta-03/lib/vm/ios/thumbv7 -ObjC -exported_symbols_list /data/myWorkspace/myGame/ios/build/robovm.tmp/thumbv7/exported_symbols -Wl,-no_implicit_dylibs -Wl,-dead_strip -miphoneos-version-min=5.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -lrobovm-bc -force_load /Users/myUserid/.m2/repository/org/robovm/robovm-dist/1.0.0-beta-03/unpacked/robovm-1.0.0-beta-03/lib/vm/ios/thumbv7/librobovm-rt.a -lrobovm-core -lgc -lpthread -ldl -lm -liconv -lsqlite3 -framework Foundation -framework AudioToolbox -framework AVFoundation -framework CoreGraphics -framework CoreTelephony -framework MessageUI -framework SystemConfiguration -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -framework GameKit -framework Foundation -framework StoreKit -weak_framework AdSupport -weak_framework StoreKit -force_load /Users/myUserid/.robovm/cache/ios/thumbv7/release/data/myWorkspace/myGame/ios/libs/admob-1.0.0-beta-01.jar.extracted/META-INF/robovm/ios/libs/libadmob.a -force_load /data/myWorkspace/myGame/ios/build/libs/ios/libgdx.a -force_load /data/myWorkspace/myGame/ios/build/libs/ios/libObjectAL.a


And here is the clang for the arm64 that failed ... and it contains the admob library twice !


14:11:37.830 [DEBUG] [org.gradle.api.Task] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o /data/myWorkspace/myGame/ios/build/robovm.tmp/arm64/myGame -arch arm64 -Wl,-filelist,/data/myWorkspace/myGame/ios/build/robovm.tmp/arm64/objects -L /Users/myUserid/.m2/repository/org/robovm/robovm-dist/1.0.0-beta-03/unpacked/robovm-1.0.0-beta-03/lib/vm/ios/arm64 -ObjC -exported_symbols_list /data/myWorkspace/myGame/ios/build/robovm.tmp/arm64/exported_symbols -Wl,-no_implicit_dylibs -Wl,-dead_strip -miphoneos-version-min=5.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -lrobovm-bc -force_load /Users/myUserid/.m2/repository/org/robovm/robovm-dist/1.0.0-beta-03/unpacked/robovm-1.0.0-beta-03/lib/vm/ios/arm64/librobovm-rt.a -lrobovm-core -lgc -lpthread -ldl -lm -liconv -lsqlite3 -framework Foundation -framework AudioToolbox -framework AVFoundation -framework CoreGraphics -framework CoreTelephony -framework MessageUI -framework SystemConfiguration -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -framework GameKit -framework Foundation -framework StoreKit -weak_framework AdSupport -weak_framework StoreKit -force_load /Users/myUserid/.robovm/cache/ios/arm64/release/data/myWorkspace/myGame/ios/libs/admob-1.0.0-beta-01.jar.extracted/META-INF/robovm/ios/libs/libadmob.a -force_load /Users/myUserid/.robovm/cache/ios/thumbv7/release/data/myWorkspace/myGame/ios/libs/admob-1.0.0-beta-01.jar.extracted/META-INF/robovm/ios/libs/libadmob.a -force_load /data/myWorkspace/myGame/ios/build/libs/ios/libgdx.a -force_load /data/myWorkspace/myGame/ios/build/libs/ios/libObjectAL.a

Bucky Beaver

unread,
Jan 20, 2015, 4:02:01 PM1/20/15
to rob...@googlegroups.com, buckybe...@gmail.com
If I just try and build 64bit on its own it fails in the same way, the clang will have a force_load for the admob library in the thumbv7 directory in the .robovm cache as well as a force_load for the admob library in the arm64 directory in the .robovm cache.

I went back to first principles and tried looking through the way org.robovm.compiler builds the clang command but it was a steep learning curve :-)

Given this is a libgdx usage of robovm with the admob robovm-ios-bindings, my build.gradle includes all the jars in the libs directory which contains the admob.jar   (the libgdx version of the admob robovm-ios-bindings that contains the libadmob.a and the stub of a robovm.xml)  and somehow this gets expanded into the .robovm cache in both the  thumv7 directory and the arm64 directory, and they both get included into the clang command.

I'm going round in circles looking at the libgdx grade, then the robovm grade, then the way the admob bindings are created - and am getting more and more confused how the 64 bit works.  Given all the robovm.xml contains   <arch>thumbv7</arch>   and only one version of the .a files exist for everything, I can't see how the  arm64  code can get linked.

What am I missing ?

Dragan A

unread,
Jan 21, 2015, 4:12:50 AM1/21/15
to rob...@googlegroups.com, buckybe...@gmail.com
FYI you are not alone with this problem. I have exactly the same problem as you describe and I'm looking forward to someone with an answer. In the meantime I decided to publish my recent libgdx game with only thumbv7 build.

Bucky Beaver

unread,
Jan 21, 2015, 2:17:45 PM1/21/15
to rob...@googlegroups.com, buckybe...@gmail.com
A bit of code reading/debugging when just using arm64 as the target architecture and I came up with:

CreateIPATask.invoke() calls AbstractRoboVMTask.configure() before it is aware of which architectures to use, and creates classpath.

This includes all the jar files including the admob jar that's in the ios/libs

/myWorkspace/myProject/ios/libs/admob-1.0.0-beta-01.jar

    

It then issues

  AppCompiler compiler = new AppCompiler(builder.build());

which calls mergeConfigsFromClasspath() which adds a thumbv7 cached version of the libadmob.a to the Config.libs because of the admob.jar that is in the classpath

/Users/myUserid/.robovm/cache/ios/thumbv7/release/myWorkspace/myProject/ios/libs/admob-1.0.0-beta-01.jar.extracted/META-INF/robovm/ios/libs/libadmob.a


It then calls

 compiler.createIpa(archs);

using arm64 as the parameter


AppCompiler.createIpa() calls Config.build() on this specific arch which causes the arm64 cached version of the libadmob.a to be added to the Config.libs


At this point there are now duplicate libadmob.a entries in the Config.libs even though one is in the thumbv7 directory in the cache and another in the arm64 directory.

So when the clang is done, we get duplicates.   

Bucky Beaver

unread,
Jan 21, 2015, 2:36:53 PM1/21/15
to rob...@googlegroups.com, buckybe...@gmail.com
Eureka - of course, it's always been a bug but we've just been getting away with it up until now!

In the past the libadmod.a was already in the libs ArrayList from the first pass, but it was the full filename from the thumbv7 directory in the .robovm cache. Then, on the second pass, the arch was thumbv7 and so it was THE SAME filename of the thumbv7 directory inside the .robovm for the second libadmob.a ... so when mergeLists added them together ... it doesn't ADD them it MERGES them and as the filename was the same, it didn't add a second copy.

So all we need to do is fix it ... and I have no idea how to (and I'm not allowed to contribute code) ... but hey, I did do some of the hard grunt-work !

Niklas Therning

unread,
Jan 22, 2015, 2:46:55 AM1/22/15
to Bucky Beaver, rob...@googlegroups.com
Thanks for the digging! Yes it's a bug: https://github.com/robovm/robovm/issues/717

Will fix it today. Should be in the next snapshot build which is pushed tonight (CET).

Niklas Therning

unread,
Jan 22, 2015, 5:55:11 AM1/22/15
to Bucky Beaver, rob...@googlegroups.com
Have pushed a fix for this now: https://github.com/robovm/robovm/issues/717. Please someone try with the next nightly/snapshot and let us know if the problem is gone.

Bucky Beaver

unread,
Jan 23, 2015, 3:11:23 PM1/23/15
to rob...@googlegroups.com, buckybe...@gmail.com
Thanks Niklas, awesome fix turnaround time, I'm impressed (and the code you are producing is pretty awesome too !)

I'd love to test the fix but I'm having trouble using the SNAPSHOT rather than the beta-03. I've changed the one-line in my build.grade that's supposed to determine the robovm level, I've deleted all caches, I've rebuilt everything, gradle cleaned/refreshed all, even deleted my projects and re-imported them .... BUT IT'S STILL PICKING UP beta 03 !!! I'm going insane here !

I realise this is a libgdx problem (how it is determining the robovm level to use) and thus I've posted a question on the libgdx forum
If anyone has any ideas then please respond to that post as I'd love to be able to test Niklas' fix !

Ethan Walaway

unread,
Jan 25, 2015, 8:59:54 AM1/25/15
to rob...@googlegroups.com, buckybe...@gmail.com
I'm facing the same issues
(1)Unable to build 64bit - duplicate symbols for architecture arm64,
(2)Unable to fetch robovm SNAPSHOT, still getting beta03, despite having:
robovm-gradle-plugin 1.0.0-beta-03
roboVMVersion 1.0.0-SNAPSHOT
gdxVersion 1.5.4-SNAPSHOT

Any luck, Bucky?

Bucky Beaver

unread,
Jan 25, 2015, 10:24:28 AM1/25/15
to rob...@googlegroups.com, buckybe...@gmail.com
Nope :-(

Looks like I'll have to wait for beta04 ... although I'm determined to work out how all this gradle stuff works and thus SHOULD (in theory) be able to get my libgdx to take the robovm SNAPSHOT.

However THANKS ETHAN for commenting saying you're getting the same problems ... it's always VERY reassuring to find out you're not alone and thus not doing something blindingly stupid :-)

(And February 1st is getting VERY close VERY quickly !!)

Pete Cornish

unread,
Jan 25, 2015, 1:34:47 PM1/25/15
to rob...@googlegroups.com, buckybe...@gmail.com
Same issue here. I've tried with roboVMVersion = '1.0-beta-04-SNAPSHOT' as of just now :( 

compile "org.robovm:robovm-rt:${roboVMVersion}"
compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"

Incidentally, I had to leave the Gradle plugin at 1.0-beta-03 as there doesn't appear to be an 04-SNAPSHOT available in the following repos:

repositories {
    mavenCentral()
    jcenter()
    mavenLocal()
}

Is this right? I can't tell from the PR, referenced above, whether the fix is in the Gradle plugin or the other dependencies. Anyway, the error is as follows:

ld: 918 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
:ios:createIPA FAILED
:ios:createIPA (Thread[main,5,main]) completed. Took 1 mins 36.014 secs.

FAILURE: Build failed with an exception.

I have attached the full build log, for this command:

sh ./gradlew -Probovm.ipaArchs=thumbv7:arm64 ios:createIPA --debug

@niklas any ideas?
ios-build.log.zip

Pete Cornish

unread,
Jan 25, 2015, 1:46:59 PM1/25/15
to rob...@googlegroups.com, buckybe...@gmail.com
OK, managed to get my buildscript dependencies updated to use the snapshot of the Gradle plugin.

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
        classpath 'org.robovm:robovm-gradle-plugin:1.0.0-SNAPSHOT'
    }
}

This resulted in the following versions being downloaded:


Which then worked for this command:

sh ./gradlew -Probovm.ipaArchs=thumbv7:arm64 ios:createIPA

Hooray!

Niklas Therning

unread,
Jan 25, 2015, 2:33:17 PM1/25/15
to Pete Cornish, rob...@googlegroups.com, Bucky Beaver
Yes, you must use the 1.0.0-SNAPSHOT version of the Gradle plugin if you want to try with the latest nightly.

Bucky Beaver

unread,
Jan 27, 2015, 12:04:15 PM1/27/15
to rob...@googlegroups.com, outof...@gmail.com, buckybe...@gmail.com
Aha !

Niklas, your fix to this problem works, I can build 64 bit - thanks.

For others who are have libgdx and want to get use the SNAPSHOT code to build it ... here's how I did it (and what I was doing wrong) (documented here as I'm bound to forget !).

In build.gradle for the main project there is a buildscript dependency for:
        classpath 'org.robovm:robovm-gradle-plugin:1.0.0-SNAPSHOT' 
and pointing that at SNAPSHOT and refreshing everything had no effect on the problem. The only sign it was doing anything is when importing the projects into eclipse after trashing the gradle-home, the first plugins to be downloaded were SNAPSHOT. When everything was built, looking at the GradleDependencies in eclipse still showed beta 03.

Also in build.gradle there is the infamous

         gdxVersion = '1.5.3'

//         gdxVersion = '1.5.4-SNAPSHOT'

        roboVMVersion = '1.0.0-beta-03'

//        roboVMVersion = '1.0.0-SNAPSHOT'

I've tried ABSOLUTELY EVERYTHING with these to try and get eclipse to show the SNAPSHOT versions of robovm as the gradleDependencies for my IOS project but to no avail, they always show beta03.


So, I followed Niklas (he who has to be bowed to) advice and installed the latest robovm eclipse plugin (took a bit of searching to find you have to use http://download.robovm.org/nightlies/eclipse/  as the eclipse update site !  The gradleDependencies for my IOS project still say beta03, but when I build it (outside of eclipse using gradlew) it builds 64 bit successfully !!  WOOHOO !!



Now if we could only fix the memory leak when it builds ...

Niklas Therning

unread,
Jan 30, 2015, 2:01:19 AM1/30/15
to Bucky Beaver, rob...@googlegroups.com, Pete Cornish
Please give some details about the memory leak problem you are experiencing. Is it similar to these?


Bucky Beaver

unread,
Jan 30, 2015, 4:01:49 AM1/30/15
to rob...@googlegroups.com, buckybe...@gmail.com, outof...@gmail.com
Yes, that is exactly what I am seeing (thanks for the pointer, I'll start looking at github issues in the future :-). If you run jvisualvm you can see the heap growing.

James Cook

unread,
Feb 7, 2015, 3:19:56 AM2/7/15
to rob...@googlegroups.com, outof...@gmail.com, buckybe...@gmail.com
So I had the same problem as yourself. So I need to move to SNAPSHOTS as well.

What I found was libGDX's RoboVM backend was pulling in the beta-03 version. (confirmed by running "./gradlew ios:dependencies"

In the Gradle build file I did this:

compile "org.robovm:robovm-rt:${roboVMVersion}"
compile
"org.robovm:robovm-cocoatouch:${roboVMVersion}"

compile
("com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion") {
      exclude
group: 'org.robovm'
}

Not sure why that dependency was taking president over the snapshot. Perhaps it is how Gradle interprets build numbers.

Any way hope that means you can build on the CLI now.

However I now get "file not found" on the linking :(

ld: file not found: /Users/user/.robovm/cache/ios/thumbv7/release/Users/user/.m2/repository/org/robovm/robovm-dist/1.0.0-SNAPSHOT/unpacked/robovm-1.0.0-SNAPSHOT/lib/robovm-rt.jar/com/android/org/bouncycastle/asn1/ASN1TaggedObjectParser.class.o
clang
: error: linker command failed with exit code 1 (use -v to see invocation)

Niklas Therning

unread,
Feb 7, 2015, 5:05:23 AM2/7/15
to James Cook, rob...@googlegroups.com, Pete Cornish, Bucky Beaver
The "file not found" error was introduced in the latest nightly. Will try to get it fixed today. Watch it here: https://github.com/robovm/robovm/issues/745.
Reply all
Reply to author
Forward
0 new messages