MobiVM / robovm-robopods

55 stars 37 forks source link

Robopods compatibility TODO #1

Closed Tom-Ski closed 8 years ago

Tom-Ski commented 8 years ago

Robopods need to be backported and tested against the fork of RoboVM. Some also can do with some updates, and possibly remove some of the deprecated platforms.

Backport:

CoderBaron commented 8 years ago

Wouldn't it make more sense and be more efficient to reverse-engineer that constructor functionality? It's very little code that can be easily recreated, even if it's just a stub functionality for the time being. The only thing we would need to update then are the poms.

jrdzha commented 8 years ago

Hi thanks so much for the effort to backport all of the robopods!

I can't be of much help with backporting, but I'd love to help with testing and writing sample code/wiki for others! It would be nice to have all of the README.md's updated :)

Tom-Ski commented 8 years ago

Hey @JahrudZ, slow but getting there.

@CoderBaron It would certainly be quicker to add it back in, however the functionality of that operation is not clear, and could all well be a simple tagging interface. It adds complexity to the bindings which makes it difficult for people to see how they work, and create their own bindings. As we don't have any automation tools to create these bindings anymore we need clear and robust examples, if that means a little more work getting them running I think that is a benefit in the long run.

The bindings are being built automatically now, and snapshots can be found at this maven repository https://oss.sonatype.org/content/repositories/snapshots/com/mobidevelop/robovm/ Only few are being built, and they don't bundle the frameworks required, so its just the raw java bindings and robovm integration at the moment. Need to check and test a few things to see if fat jars will be OK, and if that is what people want.

matthewtory commented 8 years ago

@Tom-Ski With the snapshots now on the sonatype repository, am I right in thinking I can add the following to my build.gradle and everything should work fine?

compile "com.mobidevelop.robovm:robopods-google-mobile-ads-parent:2.2.0"
compile "com.mobidevelop.robovm:robopods-google-mobile-ads-ios:2.2.0"

When I add this, I get a 'Failed to resolve com.movidevelop...' error. Am I doing something wrong?

Tom-Ski commented 8 years ago

You would need to make that 2.2.0-SNAPSHOT

matthewtory commented 8 years ago

Of course... I forgot it was a snapshot. Thanks a lot! So now that I have both dependencies, should google-mobile-ads work as intended? Or do I need to add the GoogleMobileAds.framework to my libraries, and somehow hook it up?

Tom-Ski commented 8 years ago

You'll need to download the freamework and add it to your libs dir, aswell as including it in your robovm.xml

matthewtory commented 8 years ago

So I've added the GoogleMobileAds.framework into ios/libs/, and my robovm.xml now looks like

<config>
  ...
  <frameworkPaths>
      <path>libs</path>
  </frameworkPaths>
  <frameworks>
    ...
    <framework>GoogleMobileAds</framework>
  </frameworks>
<config>

When I run the robovm project I get a whole bunch of errors, looking like:

[ERROR] Undefined symbols for architecture armv7:
[ERROR]   "_OBJC_CLASS_$_CBUUID", referenced from:
[ERROR]       objc-class-ref in GoogleMobileAds(flat-armv7)
[ERROR]   "_OBJC_CLASS_$_CBCentralManager", referenced from:
[ERROR]       objc-class-ref in GoogleMobileAds(flat-armv7)
...
[ERROR] ld: symbol(s) not found for architecture armv7

Any ideas?

Tom-Ski commented 8 years ago

You need to add CoreBluetooth and SafariServices frameworks too in your robovm.xml

matthewtory commented 8 years ago

Brilliant. It was indeed missing frameworks that caused the error. I added CoreBluetooth, SafariServices, and also found that I needed to add CoreMedia, CoreMotion, and CoreVideo as well. Thanks a lot for your help!

little-dgek commented 8 years ago

Hi, why I can not use facebook sdk? compile "com.mobidevelop.robovm:robopods-facebook-ios-login:2.2.0-SNAPSHOT"

portfort commented 8 years ago

Aargh, why does nothing just work? Every single thing I try is a new all-stops tour of hell!

I tried following this guide but as soon as I do step 3 (add GoogleMobileAds framework to robovm.xml) I get a crash Undefined symbols for architecture armv7. I also tried adding a bunch of other frameworks from the example, but the result is the same.

build script {
    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    }
    dependencies {
        classpath 'com.android.tools.build:grade:2.1.3'
        classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.2.0'
    }
}

all projects {
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = '1.0'
    ext {
        appName = "A Big Waste of Time"
        gdxVersion = '1.9.3'
        roboVMVersion = '2.2.0'
        box2DLightsVersion = '1.4'
        ashleyVersion = '1.7.0'
        aiVersion = '1.8.0'
        robopodsVersion = '2.2.0'
    }

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

project(":ios") {
    apply plugin: "java"
    apply plugin: "robovm"

    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-iso"
        compile "com.mobidevelop.robovm:robopods-google-mobile-ads-parent:2.2.0-SNAPSHOT"
        compile "com.mobidevelop.robovm:robopods-google-mobile-ads-ios:2.2.0-SNAPSHOT"
    }
}

In robovm.xml

  <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>GoogleMobileAds</framework>
    <framework>AdSupport</framework>
    <framework>AudioToolbox</framework>
    <framework>AVFoundation</framework>
    <framework>CoreGraphics</framework>
    <framework>CoreMedia</framework>
    <framework>CoreTelephony</framework>
    <framework>EventKit</framework>
    <framework>EventKitUI</framework>
    <framework>MediaPlayer</framework>
    <framework>MessageUI</framework>
    <framework>QuartzCore</framework>
    <framework>StoreKit</framework>
    <framework>SystemConfiguration</framework>
    <framework>EventKit</framework>
    <framework>EventKitUI</framework>
    <framework>SafariServices</framework>
    <framework>CoreBluetooth</framework>
    <framework>MessageUI</framework>
    <framework>SystemConfiguration</framework>
    <framework>StoreKit</framework>
    <framework>AdSupport</framework>
    <framework>CoreTelephony</framework>
    <framework>CoreData</framework>
    <framework>CoreMedia</framework>
    <framework>MediaPlayer</framework>
  </frameworks>

And the error:

[quote][ERROR] Undefined symbols for architecture armv7: [ERROR] "_OBJCCLASS$_GLKView", referenced from: [ERROR] objc-class-ref in GoogleMobileAds(flat-armv7) [ERROR] "_CVOpenGLESTextureCacheCreateTextureFromImage", referenced from: [ERROR] l2589 in GoogleMobileAds(flat-armv7) [ERROR] "_CVOpenGLESTextureGetName", referenced from: [ERROR] l2589 in GoogleMobileAds(flat-armv7) [ERROR] "_CVOpenGLESTextureCacheCreate", referenced from: [ERROR] l2588 in GoogleMobileAds(flat-armv7) [ERROR] "_CVPixelBufferGetHeight", referenced from: [ERROR] l2586 in GoogleMobileAds(flat-armv7) [ERROR](maybe you meant: _str_CVPixelBufferGetHeightOfPlane_00, _str_CVPixelBufferGetHeight_00) [ERROR] "_CVOpenGLESTextureCacheFlush", referenced from: [ERROR] l2587 in GoogleMobileAds(flat-armv7) [ERROR] "_GLKMatrix4Identity", referenced from: [ERROR] l2581 in GoogleMobileAds(flat-armv7) [ERROR] l2591 in GoogleMobileAds(flat-armv7) [ERROR](maybe you meant: _str_GLKMatrix4Identity_00) [ERROR] "_OBJCCLASS$_CMMotionManager", referenced from: [ERROR] objc-class-ref in GoogleMobileAds(flat-armv7) [ERROR] "_kCVImageBufferYCbCrMatrixKey", referenced from: [ERROR] l2586 in GoogleMobileAds(flat-armv7) [ERROR](maybe you meant: _str_kCVImageBufferYCbCrMatrixKey_00) [ERROR] "_CVPixelBufferGetWidth", referenced from: [ERROR] l2586 in GoogleMobileAds(flat-armv7) [ERROR](maybe you meant: _str_CVPixelBufferGetWidthOfPlane_00, _str_CVPixelBufferGetWidth_00) [ERROR] "_kCVImageBufferYCbCrMatrix_ITU_R_601_4", referenced from: [ERROR] l2586 in GoogleMobileAds(flat-armv7) [ERROR] "_kCVPixelBufferPixelFormatTypeKey", referenced from: [ERROR] l086 in GoogleMobileAds(flat-armv7) [ERROR](maybe you meant: _str_kCVPixelBufferPixelFormatTypeKey_00) [ERROR] "_CVOpenGLESTextureGetTarget", referenced from: [ERROR] l2589 in GoogleMobileAds(flat-armv7) [ERROR] "_CVBufferGetAttachment", referenced from: [ERROR] l2586 in GoogleMobileAds(flat-armv7) [ERROR](maybe you meant: _str_CVBufferGetAttachment_00, _str_CVBufferGetAttachments_00) [ERROR] ld: symbol(s) not found for architecture armv7 [ERROR] clang: error: linker command failed with exit code 1 (use -v to see invocation) [ERROR] Couldn't compile app[/quote]

matthewtory commented 8 years ago

It looks like you're still missing some frameworks. What I did was Google each of the error messages to find out what framework it was from. I then added the framework to the plist. I ended up having to add quite a few.

portfort commented 8 years ago

A-ha, I added a few and shortened the list quite a bit. Thanks, if I manage to get it working, I'll post the entire list.

matthewtory commented 8 years ago

Here's my list of frameworks:

<frameworks>
    <framework>UIKit</framework>
    <framework>GLKit</framework>
    <framework>CoreBluetooth</framework>
    <framework>SafariServices</framework>
    <framework>CoreVideo</framework>
    <framework>CoreMotion</framework>
    <framework>OpenGLES</framework>
    <framework>QuartzCore</framework>
    <framework>CoreGraphics</framework>
    <framework>OpenAL</framework>
    <framework>AudioToolbox</framework>
    <framework>GoogleMobileAds</framework>
    <framework>AVFoundation</framework>
    <framework>AdSupport</framework>
    <framework>CoreMedia</framework>
    <framework>CoreTelephony</framework>
    <framework>EventKit</framework>
    <framework>EventKitUI</framework>
    <framework>MediaPlayer</framework>
    <framework>MessageUI</framework>
    <framework>StoreKit</framework>
    <framework>SystemConfiguration</framework>
    <framework>WebKit</framework>
  </frameworks>
portfort commented 8 years ago

Thanks matthewtory.

I removed all the frameworks except GoogleMobileAds and then attempted to run the app while looking up and adding frameworks one by one. It turns out these are enough for me:

<frameworks>
    <framework>GoogleMobileAds</framework>
    <framework>GLKit</framework>
    <framework>CoreVideo</framework>
    <framework>OpenGLES</framework>
    <framework>CoreBluetooth</framework>
    <framework>OpenAL</framework>
    <framework>CoreMotion</framework>
    <framework>SafariServices</framework>
</frameworks>

... but if anyone is having the same problem and reading this, the proper thing to do is to look up every method and see on the Apple's developer website which framework it belongs to. For example Google CVPixelBufferGetWidth and on the Apple's developer website you'll see it belongs to CoreVideo, so add that framework and rerun and repeat until there are no more errors. I tried to save time by copying what other people had to add, and in the end I wasted a lot of time.

keesvandieren commented 8 years ago

Some robopods seems to be not present in https://oss.sonatype.org/content/repositories/snapshots/com/mobidevelop/robovm/

This artifact seems to be missing for example: robopods-google-analytics-parent

keesvandieren commented 8 years ago

Is there any plan to release robopods 2.x?

I do want to try out the snapshot robopods I'd like to use (and to report the results), but it seems that the snapshot repo is incomplete.

CoderBaron commented 8 years ago

The version number of the poms need to be in line with the latest robovm fork version. Alternatively the robovm.version property of the root pom should be set to 2.2.1-SNAPSHOT (currently resolves to 2.2.0-SNAPSHOT)

CoderBaron commented 8 years ago

PR #8 should fix all remaining issues. I tested all RoboPods and they all work now! I propose to close this issue. If something new comes up, we can create a new issue.

Tom-Ski commented 8 years ago

Great! Thanks for your work on this @CoderBaron

Tom-Ski commented 8 years ago

Will be sorting out the build this weekend, and we'll do a release for both the bindings and robovm.

centy commented 7 years ago

I have problems with running HeyZap. I see in logs sth like this: Heyzap requires a root view controller to display the test activity. Set the rootViewController property of [[[UIApplication sharedApplication] delegate] window] to fix this error. If you have any trouble doing this, contact support@heyzap.com

Any idea what is wrong?

[UPDATE] If you're using the one embedded in MobiDevelop ropopod (I believe it's 9.6.8) you'll need to do the following workaroud on didFinishLaunching: UIApplication.getSharedApplication().getDelegate().setWindow(UIApplication.getSharedApplication().getKeyWindow());

balepc commented 6 years ago

Hey,

I've implemented bindings for Game Analytics and want to share it. How can I do it better?