Bundling for Android throws error (SOLVED)

When bundling for Android Defold throws the error message “Unable to bundle application”, with the following error details:

org.eclipse.core.internal.resources.ResourceException: Errors occurred during the build.
at org.eclipse.core.internal.resources.Project$1.run(Project.java:620)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.buildProject(AbstractBundleHandler.java:63)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.run(AbstractBundleHandler.java:72)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Contains: Errors running builder ‘Content Builder’ on project ‘Hammerwatch’.
org.eclipse.core.runtime.CoreException: Build failed: location /var/folders/f4/6sv_1cdd731_fty7yk375tj00000gn/T/80285507188804888/lib/android.jar not found
at com.dynamo.cr.editor.builders.ContentBuilder.buildLocal(ContentBuilder.java:177)
at com.dynamo.cr.editor.builders.ContentBuilder.build(ContentBuilder.java:83)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.buildProject(AbstractBundleHandler.java:63)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.run(AbstractBundleHandler.java:72)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: com.dynamo.bob.CompileExceptionError: location /var/folders/f4/6sv_1cdd731_fty7yk375tj00000gn/T/80285507188804888/lib/android.jar not found
at com.dynamo.bob.Project.build(Project.java:259)
at com.dynamo.cr.editor.builders.ContentBuilder.buildLocal(ContentBuilder.java:135)
… 13 more
Caused by: java.lang.RuntimeException: location /var/folders/f4/6sv_1cdd731_fty7yk375tj00000gn/T/80285507188804888/lib/android.jar not found
at com.dynamo.bob.Bob.getPath(Bob.java:104)
at com.dynamo.bob.bundle.AndroidBundler.bundleApplication(AndroidBundler.java:134)
at com.dynamo.bob.Project.bundle(Project.java:397)
at com.dynamo.bob.Project.doBuild(Project.java:449)
at com.dynamo.bob.Project.build(Project.java:254)
… 14 more
Contains: Build failed: location /var/folders/f4/6sv_1cdd731_fty7yk375tj00000gn/T/80285507188804888/lib/android.jar not found
com.dynamo.bob.CompileExceptionError: location /var/folders/f4/6sv_1cdd731_fty7yk375tj00000gn/T/80285507188804888/lib/android.jar not found
at com.dynamo.bob.Project.build(Project.java:259)
at com.dynamo.cr.editor.builders.ContentBuilder.buildLocal(ContentBuilder.java:135)
at com.dynamo.cr.editor.builders.ContentBuilder.build(ContentBuilder.java:83)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.buildProject(AbstractBundleHandler.java:63)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.run(AbstractBundleHandler.java:72)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.lang.RuntimeException: location /var/folders/f4/6sv_1cdd731_fty7yk375tj00000gn/T/80285507188804888/lib/android.jar not found
at com.dynamo.bob.Bob.getPath(Bob.java:104)
at com.dynamo.bob.bundle.AndroidBundler.bundleApplication(AndroidBundler.java:134)
at com.dynamo.bob.Project.bundle(Project.java:397)
at com.dynamo.bob.Project.doBuild(Project.java:449)
at com.dynamo.bob.Project.build(Project.java:254)
… 14 more

I just bundled for Android without problems on Mac OS X. What platform are you running on? Check if the target path contain whitespaces or special characters.

I am also on OSX. There is a space in the name of the volume, but I have bundled before to the same path without problems.

It seems the good ol’ “restart the environment” solved the issue

Good, but weird that the error happened in the first place. If you manage to reproduce it, please let us know.

I have the exact same issue for the iOS bundle. The error message is identical with Johans. I restarted my Mac, but it didn’t help.

It works when I build for Android. Can it be something wrong with infoplist?

Do you know any fix for this?

Could you please try with the most recent Defold version (released today), and if it still happens then please post the full stack trace here.

Downloaded the new version, still the same problem =/

org.eclipse.core.internal.resources.ResourceException: Errors occurred during the build.
at org.eclipse.core.internal.resources.Project$1.run(Project.java:620)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.buildProject(AbstractBundleHandler.java:63)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.run(AbstractBundleHandler.java:72)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Contains: Errors running builder ‘Content Builder’ on project ‘Catapult’.
org.eclipse.core.runtime.CoreException: Build failed: /Users/User/Documents/SKBUILDS/Sling a Kitty.app: invalid resource specification rule(s)

at com.dynamo.cr.editor.builders.ContentBuilder.buildLocal(ContentBuilder.java:177)
at com.dynamo.cr.editor.builders.ContentBuilder.build(ContentBuilder.java:83)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.buildProject(AbstractBundleHandler.java:63)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.run(AbstractBundleHandler.java:72)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Caused by: com.dynamo.bob.CompileExceptionError: /Users/User/Documents/SKBUILDS/Sling a Kitty.app: invalid resource specification rule(s)

at com.dynamo.bob.Project.build(Project.java:259)
at com.dynamo.cr.editor.builders.ContentBuilder.buildLocal(ContentBuilder.java:135)
... 13 more

Caused by: java.io.IOException: /Users/User/Documents/SKBUILDS/Sling a Kitty.app: invalid resource specification rule(s)

at com.dynamo.bob.bundle.IOSBundler.bundleApplication(IOSBundler.java:231)
at com.dynamo.bob.Project.bundle(Project.java:397)
at com.dynamo.bob.Project.doBuild(Project.java:449)
at com.dynamo.bob.Project.build(Project.java:254)
... 14 more

Contains: Build failed: /Users/User/Documents/SKBUILDS/Sling a Kitty.app: invalid resource specification rule(s)

com.dynamo.bob.CompileExceptionError: /Users/User/Documents/SKBUILDS/Sling a Kitty.app: invalid resource specification rule(s)

at com.dynamo.bob.Project.build(Project.java:259)
at com.dynamo.cr.editor.builders.ContentBuilder.buildLocal(ContentBuilder.java:135)
at com.dynamo.cr.editor.builders.ContentBuilder.build(ContentBuilder.java:83)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.buildProject(AbstractBundleHandler.java:63)
at com.dynamo.cr.editor.handlers.AbstractBundleHandler$BundleRunnable.run(AbstractBundleHandler.java:72)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Caused by: java.io.IOException: /Users/User/Documents/SKBUILDS/Sling a Kitty.app: invalid resource specification rule(s)

at com.dynamo.bob.bundle.IOSBundler.bundleApplication(IOSBundler.java:231)
at com.dynamo.bob.Project.bundle(Project.java:397)
at com.dynamo.bob.Project.doBuild(Project.java:449)
at com.dynamo.bob.Project.build(Project.java:254)
... 14 more

Did you update the editor, if so, could you try downloading a fresh installation?

Do you have Xcode installed, what version?

I updated the editor. What do you mean with a fresh installation?. I don’t use Xcode for defold, I just build an IPA an go through iTunes. It has worked several times before.

1 Like

By fresh installation I mean: if you could download the editor again into a new separate folder and try bundling.

The error you get, “invalid resource specification rule(s)”, comes from a program we call during the IPA-signing process. This program, simply called “codesign”, could possibly be an old version on your system. This is why I asked about Xcode version, since I suspect Xcode updates the codesign program.

We recently updated the iOS SDK version we use when creating the defold runtime binary, and in this update also removed some deprecated parameters to the codesign program in our bundling process… It would therefore be interesting to know if you have Xcode installed, and if so, what version. (Even if you don’t use it yourself in the build process. :wink: )

1 Like

Can you please tell us what version of OS X you are running ?
Or even better a system report (About this Mac -> Overview -> System Report).

We have tested our compatibility back to OS X Mavericks 10.9.
If you are running an earlier version, your problem should be fixed by updating your OS X installation (Mavericks 10.9 or later).
Starting with Mavericks 10.9, the resource-rules parameter used by codesign_allocate is obsolete.
We are bundling a version of codesign_allocate with Defold to be able to bundle without an XCode installation.
This version is not compatible with codesign versions earlier than that shipped with OS X Mavericks 10.9.
More info in Apple Technical Note TN2206.

1 Like

Small update, just checked what system we actually tested on by Andreas request and it’s in fact OS X Yosemite 10.10 and not Mavericks.

1 Like

Thank you for the quick response.

I’ve downloaded the editor again, but I ran into the same error.

Here’s the versions I use and a system report for my Mac.

Defold Editor
Version 1.2.73
Java 1.8.0_05

Xcode Version 7.2 (7C68)

OS X El Capitan Version 10.11.3

Modellnamn: MacBook Pro
Modellidentifierare: MacBookPro8,2
Processornamn: Intel Core i7
Processorhastighet: 2,3 GHz
Antal processorer: 1
Totalt antal kärnor: 4
L2-cache (per kärna): 256 K
L3-cache: 8 MB
Minne: 10 GB
Boot ROM-version: MBP81.0047.B2C
SMC-version (system): 1.69f3
Serienummer (system): C02GK190DRJM
Maskinvaru-UUID: 99C8D48A-E370-5BB5-B99B-9CCDCF8DEF8E
Rörelsedetektor (Sudden Motion Sensor):
Status: Aktiverad

Thank you.

Hi again.

The Java version won’t affect anything to do with the codesigning. What I was after was your XCode and OSX versions, which both should definitely work. What seems to happen is that the resource rules is still set in your info.plist.

Are you using a custom info.plist or any custom build-step (in game project settings, the infoplist under the iOS settings should also be blank) ?
If so, I might get one step ahead:
The “invalid resource specification rule(s)” will be reported and the signing will fail on newer toolchains as this setting is if there is resource rules defined. In info.plist you need to remove the following key:

< key > CFBundleResourceSpecification< /key >
< string >ResourceRules.plist< /string >

More info on custom build-steps and steps necessary to take from version 1.2.71 where we updated to iOS9 here:
Defold 1.2.71 has been released

Let me know and we’ll take it from there…

1 Like

Yes I’m using a custom info.plist. I edited the plist now as you said and it seems to work. Thank you! :smile:

1 Like