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

[WARNING] Classpath entry /projectpath/out/production/ios does not exist #320

Closed freakanzy closed 6 years ago

freakanzy commented 6 years ago

Issue details

I've been trying to run my app through Intelij Idea, after I was unable to do so with Android studio (my issue with Android Studio is described here: https://github.com/MobiVM/robovm/issues/305 ). My Libgdx project is set up with only core, desktop and ios modules. The problem in Intelij Idea seems to be that RoboVM is trying to use access "/projectpath/out/production/ios", which does not exist. In finder I can find "/projectpath/ios/out/production/", but even in that folder there is no "ios" subfolder at the moment.

I'd really appreciate a sollution to this mess, been stuck for more than a month between Android Studio, Intelij Idea and bad internet access.

Reproduction steps/code

Trying to test the app on my cellphone using RoboVM

Configuration

Gradle wrapper: distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip (also tried 4.6)

robovm.xml:

<config>
  <executableName>${app.executable}</executableName>
  <mainClass>${app.mainclass}</mainClass>
  <os>ios</os>
  <arch>thumbv7</arch>
  <target>ios</target>
  <iosInfoPList>Info.plist.xml</iosInfoPList>
  <resources>
    <resource>
      <directory>../android/assets</directory>
      <includes>
        <include>**</include>
      </includes>
      <skipPngCrush>true</skipPngCrush>
    </resource>
    <resource>
      <directory>data</directory>
    </resource>
  </resources>
  <forceLinkClasses>
    <pattern>com.badlogic.gdx.scenes.scene2d.ui.*</pattern>
    <pattern>com.badlogic.gdx.graphics.g3d.particles.**</pattern>
    <pattern>com.android.okhttp.HttpHandler</pattern>
    <pattern>com.android.okhttp.HttpsHandler</pattern>
    <pattern>com.android.org.conscrypt.**</pattern>
    <pattern>com.android.org.bouncycastle.jce.provider.BouncyCastleProvider</pattern>
    <pattern>com.android.org.bouncycastle.jcajce.provider.keystore.BC$Mappings</pattern>
    <pattern>com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi</pattern>
    <pattern>com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$Std</pattern>
    <pattern>com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi</pattern>
    <pattern>com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryOpenSSL</pattern>
    <pattern>org.apache.harmony.security.provider.cert.DRLCertFactory</pattern>
    <pattern>org.apache.harmony.security.provider.crypto.CryptoProvider</pattern>
  </forceLinkClasses>
  <libs>
      <lib>z</lib>   
  </libs>
  <frameworkPaths>
      <path>libs</path>
  </frameworkPaths>
  <frameworks>
    <framework>UIKit</framework>
    <framework>OpenGLES</framework>
    <framework>QuartzCore</framework>
    <framework>CoreGraphics</framework>
    <framework>OpenAL</framework>
    <framework>AudioToolbox</framework>
    <framework>AVFoundation</framework>
    <framework>StoreKit</framework>
    <framework>WebKit</framework>
    <framework>Foundation</framework>
    <framework>Chartboost</framework>
    <framework>FBSDKCoreKit</framework>
  </frameworks>
</config>

Project bulid.gradle:

buildscript {
    project.ext.roboVMVersion = "2.3.4"
    project.ext.roboVMGradleVersion = "2.3.4"

    project.ext.robopodsVersion = "2.2.2"

    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://plugins.gradle.org/m2/" }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        jcenter()
        google()
    }
    dependencies {
     classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:4.0.1'

        classpath group: 'com.mobidevelop.robovm', name: 'robovm-gradle-plugin', version: project.roboVMGradleVersion        

    }
}

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

    version = '1.0'
    ext {
        appName = "App"
        gdxVersion = '1.9.8'
        roboVMVersion = '2.3.4'
        box2DLightsVersion = '1.4'
        ashleyVersion = '1.7.0'
        aiVersion = '1.8.0'
    }

    repositories {
        mavenLocal()
        mavenCentral()
        google()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
  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(":ios") {
    apply plugin: "java"
    apply plugin: "robovm"

    compileJava {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }
    dependencies {
        implementation project(":core")
        implementation "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
        implementation "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
        implementation "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
        implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
        implementation "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
        implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
        implementation group: 'com.mobidevelop.robovm', name: 'robovm-rt', version: project.roboVMVersion
        implementation group: 'com.mobidevelop.robovm', name: 'robovm-cocoatouch', version: project.roboVMVersion
        implementation "com.mobidevelop.robovm:robopods-chartboost-ios:$robopodsVersion"
        implementation "com.mobidevelop.robovm:robopods-reachability-ios:$robopodsVersion"
        implementation "com.mobidevelop.robovm:robopods-facebook-ios-login:$robopodsVersion"
        implementation "com.mobidevelop.robovm:robopods-facebook-ios-core:$robopodsVersion"
        implementation "com.mobidevelop.robovm:robopods-facebook-ios-share:$robopodsVersion"
        implementation "com.mobidevelop.robovm:robopods-billing-core:$robopodsVersion"
        implementation "com.mobidevelop.robovm:robopods-billing-ios:$robopodsVersion"
        implementation "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"

    }
}

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

Build Tools:

Versions:

Build Targets: iPhone 5S

Stacktrace

[INFO] Loading default RoboVM config properties file: /projectpath/ios/robovm.properties
[INFO] Loading default RoboVM config file: /projectpath/ios/robovm.xml
[INFO] Building executable in /projectpath/ios/robovm-build/tmp/Unnamed/ios/thumbv7
[INFO] Installation of app in /projectpath/ios/robovm-build/tmp/Unnamed/ios/thumbv7
[INFO] classpath entry: /projectpath/out/production/ios
[INFO] Using SDK boot classpath
[INFO] Cleaning output dir /projectpath/ios/robovm-build/tmp/Unnamed/ios/thumbv7
[WARNING] Classpath entry /projectpath/out/production/ios does not exist
[ERROR] Couldn't compile app
org.robovm.compiler.CompilerException: Main class com.app.IOSLauncher not found
    at org.robovm.compiler.AppCompiler.getRootClasses(AppCompiler.java:270)
    at org.robovm.compiler.AppCompiler.compile(AppCompiler.java:452)
    at org.robovm.compiler.AppCompiler.build(AppCompiler.java:775)
    at org.robovm.idea.compilation.RoboVmCompileTask$4.doCompile(RoboVmCompileTask.java:291)
    at org.robovm.idea.compilation.RoboVmCompilerThread.run(RoboVmCompilerThread.java:66)
davidgiga1993 commented 6 years ago

I've got the same issue

[INFO] Building executable in /Users/david/IdeaProjects/myProject/ios/robovm-build/tmp/Test/ios/x86_64
[INFO] Installation of app in /Users/david/IdeaProjects/myProject/ios/robovm-build/tmp/Test/ios/x86_64
[INFO] classpath entry: /Users/david/IdeaProjects/myProject/out/production/ios
[INFO] Using SDK boot classpath
[INFO] Cleaning output dir /Users/david/IdeaProjects/myProject/ios/robovm-build/tmp/Test/ios/x86_64
[WARNING] Classpath entry /Users/david/IdeaProjects/myProject/out/production/ios does not exist
davidgiga1993 commented 6 years ago

A solution would be to symlink the folders:

in project root:

mkdir -p out/production/
cd out/production/
ln -s ../../ios/out/production/classes ios
freakanzy commented 6 years ago

Thank you so much, that worked perfectly!

I later spent another 4 hours fixing an unrelated RoboVM problem, but now my app works :D