MobiVM / robovm

Ahead of time compiler for JVM bytecode targetting iOS, Mac OSX and Linux
https://mobivm.github.io
957 stars 132 forks source link

Error running 'robo': @NotNull method org/robovm/idea/running/RoboVmRunProfileState.startProcess must not return null #305

Closed freakanzy closed 6 years ago

freakanzy commented 6 years ago

Issue details

After updating Android Console to the latest build, I am getting the following error when trying to deploy my LibGDX App through RoboVM:

[INFO] Launching executable
[ERROR] Couldn't start application
java.lang.NullPointerException
    at org.robovm.idea.running.RoboVmRunProfileState.executeRun(RoboVmRunProfileState.java:57)
    at org.robovm.idea.running.RoboVmRunProfileState.startProcess(RoboVmRunProfileState.java:114)
    at com.intellij.execution.configurations.CommandLineState.execute(CommandLineState.java:80)
    at org.robovm.idea.running.RoboVmRunner.doExecute(RoboVmRunner.java:79)
    at com.intellij.execution.runners.GenericProgramRunner$execute$$inlined$runProfileStarter$1.executeAsync(GenericProgramRunner.kt:69)
    at com.intellij.execution.runners.GenericProgramRunnerKt$startRunProfile$$inlined$runProfileStarter$1.executeAsync(GenericProgramRunner.kt:69)
    at com.intellij.execution.impl.ExecutionManagerKtImpl$startRunProfile$startRunnable$1.run(ExecutionManagerKtImpl.kt:75)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
    at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:111)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:120)
    at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122)
    at com.intellij.execution.impl.ExecutionManagerKtImpl$startRunProfile$2.run(ExecutionManagerKtImpl.kt:128)
    at com.intellij.openapi.project.DumbServiceImpl.updateFinished(DumbServiceImpl.java:299)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
    at com.intellij.openapi.application.TransactionGuardImpl.lambda$pollQueueLater$0(TransactionGuardImpl.java:74)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

At first I had a problem with the iOS 11.4 . Prior to that everything worked ok, but after the iOS update the touch coordinates just stopped matching the screen coordinates. So I decided to update the Android Studio and see if that helps at all and now the app won't deploy at all any more and I get the error mentioned above.

This is my build.gradle for main project:

buildscript {

    project.ext.roboVMVersion = "2.3.4-SNAPSHOT"
    project.ext.roboVMGradleVersion = "2.3.4-SNAPSHOT"

    project.ext.robopodsVersion = "2.2.2"

    repositories {
        mavenLocal()
        mavenCentral()
        google()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
//        classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1'
        classpath 'org.multi-os-engine:moe-gradle:1.4.0'
        classpath 'com.google.gms:google-services:3.1.2'
        classpath group: 'com.mobidevelop.robovm', name: 'robovm-gradle-plugin', version: project.roboVMGradleVersion

    }
}

allprojects {
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = '1.0'
    ext {
        appName = "whatever"
        gdxVersion = '1.9.9-SNAPSHOT'
        roboVMVersion = '2.3.4-SNAPSHOT'
        box2DLightsVersion = '1.4'
        ashleyVersion = '1.7.0'
        aiVersion = '1.8.0'
    }

    repositories {
        google()
        mavenLocal()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
        /** The default repository for Android Studio projects */
        jcenter()
        /** The repository required for AdColony 3.0 and above */
        maven {
            url  "https://adcolony.bintray.com/AdColony"
        }
    }
}

project(":desktop") {
    apply plugin: "java"

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
        compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
        compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"

    }
}

project(":android") {
    apply plugin: "android"

    configurations { natives }

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
        compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"

    }
}

project(":ios") {
    apply plugin: "java"
    apply plugin: "robovm"
    compileJava {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }

    repositories {
        mavenCentral()
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
    }

    dependencies {

        compile project(":core")
        compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
        compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
        compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
        compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
        compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
        // https://mvnrepository.com/artifact/com.mobidevelop.robovm/robopods-chartboost-parent
//        compile group: 'com.mobidevelop.robovm', name: 'robopods-chartboost-parent', version: '2.2.2', ext: 'pom'
        compile group: 'com.mobidevelop.robovm', name: 'robovm-rt', version: project.roboVMVersion
        compile group: 'com.mobidevelop.robovm', name: 'robovm-cocoatouch', version: project.roboVMVersion
        compile "com.mobidevelop.robovm:robopods-chartboost-ios:$robopodsVersion"
        compile "com.mobidevelop.robovm:robopods-reachability-ios:$robopodsVersion"
//        compile "com.mobidevelop.robovm:robopods-facebook-ios:$robopodsVersion"
//        compile "com.mobidevelop.robovm:robopods-facebook-ios-audience:$robopodsVersion"
        compile "com.mobidevelop.robovm:robopods-facebook-ios-login:$robopodsVersion"
        compile "com.mobidevelop.robovm:robopods-facebook-ios-core:$robopodsVersion"
        compile "com.mobidevelop.robovm:robopods-facebook-ios-share:$robopodsVersion"
        compile "com.mobidevelop.robovm:robopods-billing-core:$robopodsVersion"
        compile "com.mobidevelop.robovm:robopods-billing-ios:$robopodsVersion"
        compile "com.mobidevelop.robovm:robopods-firebase-ios-analytics:$robopodsVersion"

    }
}

project(":core") {
    apply plugin: "java"

    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"

    }
}

project(":ios-moe") {
    apply plugin: "moe"

    configurations { natives }

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-moe:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"

    }
}

subprojects {
    if(it.name != "android") { // android plugin is not compatible with java plugin
        apply plugin: "java"
        apply plugin: "idea"
        idea {
            module {
                scopes.PROVIDED.minus += [configurations.compile]
                scopes.COMPILE.plus += [configurations.compile]
            }
        }
    }
}

tasks.eclipse.doLast {
    delete ".project"
}

Versions:

Build Targets: iPhone 5s, device

Any suggestions about how to get rid of this problem? Also I don't know what happened with those touch coordinates, everything really used to work surprisingly well before iOS 11.4 and Android Studio updates.

Thanks!

dkimitsa commented 6 years ago

its a duplicate of https://github.com/MobiVM/robovm/issues/242 https://github.com/MobiVM/robovm/issues/303

is short: use standalone idea with disabled android plugin. or there is bunch of dirty hacks, last one I described in this post: https://dkimitsa.github.io/2018/05/04/idea-fixing-android-gradle-facet3/

florianf commented 6 years ago

Duplicate, closed.