Error creating ipa for ipad: "Could not call BaseAirMobilePackage.launch()"

Andreas's Avatar

Andreas

14 Nov, 2013 11:29 AM

Hi,

when I try to compile a flex/air application i get the following error:
Could not call BaseAirMobilePackage.launch() on task ':packageMobile' I am using gradle 1.8.

my gradle file (I changed file names and my password is not 'password') :

defaultTasks 'installMobile'
apply plugin: 'gradlefx'
apply plugin: 'maven'
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath group: 'org.gradlefx', name: 'gradlefx', version: '0.7'
    }
}
version = '1.0-SNAPSHOT'
type = 'mobile'
repositories {
    add(new org.apache.ivy.plugins.resolver.URLResolver()) {
        name = 'Apache'
        addArtifactPattern 'http://apache.cu.be/flex/[revision]/binaries/[module]-[revision]-bin.[ext]'
    }
    add(new org.apache.ivy.plugins.resolver.URLResolver()) {
            name = 'Adobe Air SDK'
            addArtifactPattern 'http://download.macromedia.com/air/win/download/[revision]/[module].[ext]'
    }
}
dependencies {
    flexSDK group: 'org.apache', name: 'apache-flex-sdk', version: '4.9.1', ext: 'tar.gz'
    airSDK  group: 'com.adobe', name: 'AdobeAIRSDK', version: '3.4', ext: 'zip'
}
additionalCompilerOptions = [
  '-headless-server=true'
]
sdkAutoInstall {
    showPrompts = false
}
srcDirs = ['src/']
mainClass = 'Main.mxml'
air {
    keystore = "myp12.p12"
    storepass = "password"
    applicationDescriptor = "app.xml"
    includeFileTrees = [
        fileTree(dir: 'src/', include: 'assets/')
    ]
}
airMobile {
    platform = 'ios'
    outputExtension = 'ipa'
    target = 'ipa-debug'
    provisioningProfile = "myProvisionFile.mobileprovision"
}
  1. Support Staff 1 Posted by Yennick Trevels on 14 Nov, 2013 11:35 AM

    Yennick Trevels's Avatar

    Hi,

    Can you try to run the packageMobile task by adding '--info' to your gradle command, and see if there's an exception or some other error message in there?

    Thanks

  2. 2 Posted by Andreas on 14 Nov, 2013 12:02 PM

    Andreas's Avatar

    The only exception I get is "Could not call BaseAirMobilePackage.launch() on task ':packageMobile' "

    12:58:45.703 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :packageMobile (Thread[main,5,main]) completed. Took 9.541 secs.
    12:58:45.704 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 9.751 secs, idle: 0.018 secs
    12:58:45.715 [ERROR] [org.gradle.BuildExceptionReporter] 
    12:58:45.717 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
    12:58:45.718 [ERROR] [org.gradle.BuildExceptionReporter] 
    12:58:45.719 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
    12:58:45.720 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':packageMobile'.
    12:58:45.720 [ERROR] [org.gradle.BuildExceptionReporter] > Could not call BaseAirMobilePackage.launch() on task ':packageMobile'
    12:58:45.733 [ERROR] [org.gradle.BuildExceptionReporter] 
    12:58:45.733 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
    12:58:45.735 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':packageMobile'.
    12:58:45.735 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    12:58:45.736 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    12:58:45.736 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    12:58:45.737 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    12:58:45.738 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    12:58:45.738 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    12:58:45.739 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    12:58:45.740 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    12:58:45.740 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    12:58:45.741 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:283)
    12:58:45.741 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    12:58:45.742 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    12:58:45.743 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    12:58:45.743 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$1.run(DefaultTaskPlanExecutor.java:33)
    12:58:45.744 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.Factories$1.create(Factories.java:22)
    

    P.S.
    I changed my gradle config to use the air SDK for mac:

    repositories {
        add(new org.apache.ivy.plugins.resolver.URLResolver()) {
            name = 'Apache'
            addArtifactPattern 'http://apache.cu.be/flex/[revision]/binaries/[module]-[revision]-bin.[ext]'
        }
        add(new org.apache.ivy.plugins.resolver.URLResolver()) {
                name = 'Adobe Air SDK'
                addArtifactPattern 'http://download.macromedia.com/air/mac/download/[revision]/[module].[ext]'
        }
    }
    dependencies {
        flexSDK group: 'org.apache', name: 'apache-flex-sdk', version: '4.11.0', ext: 'tar.gz'
        airSDK  group: 'com.adobe', name: 'AdobeAIRSDK', version: '3.9', ext: 'tbz2'
    }
    
  3. Support Staff 3 Posted by Yennick Trevels on 14 Nov, 2013 02:49 PM

    Yennick Trevels's Avatar

    I'll have to do some debugging on this to know what's going wrong. I'll let you know when I know more.

  4. Support Staff 4 Posted by Yennick Trevels on 14 Nov, 2013 07:27 PM

    Yennick Trevels's Avatar

    I've been able to reproduce the error message (in my case by defining a provisioning file which doesn't exist). But above the ":packageMobile FAILED" message I can see exactly what went wrong. In my case it looks like this:

    :packageMobile
    [ant:java] Java Result: 12
    E:\Users\Yennick\Development\GradleFx\GradleFx-Examples\mobile-android\myProvisionFile.mobileprovision (The system cannot find the file specified)
    :packageMobile FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':packageMobile'.
    > Could not call BaseAirMobilePackage.launch() on task ':packageMobile'
    
  5. 5 Posted by Andreas on 14 Nov, 2013 10:26 PM

    Andreas's Avatar

    Well, I do not have such a nice error message, but the "Compilation failed while executing : as" reads suspicious, but I can only assume that it means something.

    Here is some more of my debug output:

    23:09:22.610 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Execute:Java13CommandLauncher: Executing '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java' with arguments:
    '-jar'
    '/private/var/root/.gradle/gradleFx/sdks/5e4c11863d8d254fac81f1b65e56a7f288caecc6/lib/adt.jar'
    '-package'
    '-target'
    'ipa-debug'
    '-provisioning-profile'
    'myProvisionFile.mobileprovision'
    '-storetype'
    'pkcs12'
    '-keystore'
    'myp12.p12'
    '-storepass'
    'password'
    '/Users/Andreas/coding/project/build/project.ipa'
    '/Users/Andreas/coding/project/app.xml'
    'build/file.swf'
    '-C'
    'assets/Startscreen.png'
    'assets/video.mp4'
    
    The ' characters around the executable and arguments are
    not part of the command.
    23:09:31.300 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Setting project property: adtOutput -> Compilation failed while executing : as
    23:09:31.301 [ERROR] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:java] Java Result: 12
    23:09:31.301 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Setting project property: adtResult -> 12
    23:09:31.318 [ERROR] [gradlefx] Compilation failed while executing : as
    23:09:31.323 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@7a03411a, org.gradle.logging.internal.logback.LogbackLoggingConfigurer@6ba7508a, org.gradle.logging.internal.JavaUtilLoggingConfigurer@3598cb3d]
    23:09:31.324 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':packageMobile'
    23:09:31.325 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :packageMobile FAILED
    23:09:31.326 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :packageMobile (Thread[main,5,main]) completed. Took 9.008 secs.
    23:09:31.327 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 9.233 secs, idle: 0.015 secs
    23:09:31.332 [ERROR] [org.gradle.BuildExceptionReporter] 
    23:09:31.334 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
    23:09:31.335 [ERROR] [org.gradle.BuildExceptionReporter] 
    23:09:31.335 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
    23:09:31.336 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':packageMobile'.
    23:09:31.337 [ERROR] [org.gradle.BuildExceptionReporter] > Could not call BaseAirMobilePackage.launch() on task ':packageMobile'
    23:09:31.339 [ERROR] [org.gradle.BuildExceptionReporter] 
    23:09:31.339 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
    23:09:31.341 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':packageMobile'.
    
  6. Support Staff 6 Posted by Yennick Trevels on 15 Nov, 2013 07:51 PM

    Yennick Trevels's Avatar

    After some research on the web it appears like the "Compilation failed while executing: as" is the error message you need.

    Here's a workaround that apparently should fix this:

    You will need to manipulate the file permissions to make the following binary files in your sdk executable:
    
    /lib/aot/bin/as/arm-apple-darwin9-as
    /lib/aot/bin/ld64/i686-apple-darwin9-ld64
    /lib/aot/bin/ld64/i686-apple-darwin10-ld64
    /lib/aot/bin/strip/i686-apple-darwin10-strip
    /lib/aot/bin/strip/strip
    
    you can change the permissions of those files using the following command in terminal
    
    chmod u+x /Users/xxxx/SDKs/Flex_4.6_Air_3.1/lib/aot/bin/as/arm-apple-darwin9-as
    

    In the next version of GradleFx all AIR & Flex SDK files will receive execution permissions upon installation.

  7. 7 Posted by Andreas on 16 Nov, 2013 03:52 PM

    Andreas's Avatar

    thank you, Yennick! I just successfully compiled and packaged an ipa-file!
    I only see a black screen when I start my app, but I think that is because I forgot the Default-Landscape.png in my includeFileTrees.

  8. Andreas closed this discussion on 16 Nov, 2013 05:55 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac