Home Features Docs Blog Support GitHub

Execution failed for task ':moeUpdateXcodeSettings'


(Wesam) #1

When I try to update my Xcode project settings by running the following command in my project’s ios directory ../gradlew moeUpdateXcodeSettings -Pmoe.forced.update --stacktrace I get the error shown below.

The answers in this forum post did not work for me. I still get the same error.

> Configure project :
Using already downloaded SDK: /Users/welshamy/.moe/moe-sdk-1.4.0


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':moeUpdateXcodeSettings'.
> java.lang.NullPointerException (no error message)

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

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':moeUpdateXcodeSettings'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.NullPointerException
        at org.moe.generator.project.writer.XcodeEditor.update(XcodeEditor.java:187)
        at org.moe.gradle.tasks.UpdateXcodeSettings.run(UpdateXcodeSettings.java:83)
        at org.moe.gradle.tasks.AbstractBaseTask.runInternal(AbstractBaseTask.java:105)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:141)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:731)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:705)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
        ... 27 more


* Get more help at https://help.gradle.org

BUILD FAILED in 0s
1 actionable task: 1 executed

My ios module’s build.gradle file looks like:

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        mavenLocal()
    }
    dependencies {
        // Multi-OS Engine plugin
        classpath 'com.android.tools.build:gradle:2.3.0'

        classpath group: 'org.multi-os-engine', name: 'moe-gradle', version: '1.4.0'
    }
}

// Apply plugins
apply plugin: 'moe'

// Set source and target to Java 8
sourceCompatibility = "1.8"
targetCompatibility = "1.8"

// Set maven repository
repositories {
    jcenter()
    flatDir {
        dirs 'libs'
    }

}

// Exclude all files from Gradle's test runner
test { exclude '**' }

// Setup Multi-OS Engine
moe {
    xcode {
        project 'xcode/YOURGATSBY.xcodeproj'
        mainTarget 'YOURGATSBY'
        testTarget 'YOURGATSBY-Test'

        // Uncomment and change these settings if you are working with a Xcode workspace
        // workspace 'xcode/YOURGATSBY.xcworkspace'
        // mainScheme 'YOURGATSBY'
        // testScheme 'YOURGATSBY-Test'
    }
}

def ormlite_version = "5.0"
dependencies {
    // Compile with 'jar' files in the project's 'lib' directory
    compileOnly fileTree(dir: '../app/libs', include: '*.jar')
    implementation fileTree(include: '*.jar', dir: 'libs')

    implementation project(':common')
    implementation project(':bom')
    implementation project(':client')

    implementation "com.j256.ormlite:ormlite-core:${ormlite_version}"
    implementation "com.j256.ormlite:ormlite-jdbc:${ormlite_version}"
    implementation "io.reactivex.rxjava2:rxjava:2.1.6"
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.2'
    implementation "com.squareup.retrofit2:retrofit:2.2.0"

}

(Saeed) #2

Dear @welshamy,

try this gradle configuration:

buildscript {
    repositories {
        jcenter()
        mavenLocal()
    }
    dependencies {
        // Multi-OS Engine plugin
        classpath group: 'org.multi-os-engine', name: 'moe-gradle', version: '1.4.+'
    }
}

// Apply plugins
apply plugin: 'eclipse'
apply plugin: 'moe'

// Set source and target to Java 8
sourceCompatibility = "1.8"
targetCompatibility = "1.8"

// Set maven repository
repositories {
    jcenter()
}

// Exclude all files from Gradle's test runner
test { exclude '**' }

// Setup Multi-OS Engine
moe {
    xcode {
        project 'xcode/ProjectName.xcodeproj'
        mainTarget 'ProjectName'
        testTarget 'ProjectName-Test'

        // Uncomment and change these settings if you are working with a Xcode workspace
        workspace 'xcode/ProjectName.xcworkspace'
        mainScheme 'ProjectName'
        testScheme 'ProjectName-Test'
    }
}

dependencies {
    // Compile with 'jar' files in the project's 'lib' directory
    compile fileTree(include: '*.jar', dir: 'lib')
}

// Setup Eclipse
eclipse {
    // Set Multi-OS Engine nature
    project {
        natures 'org.multi-os-engine.project'
    }
}

(Roland Vigh - Migeran) #3

Hi!

Thanks for the report, we will take a look.

Best Regards,
Roland