ibinti / bugvm

This is BugVM
352 stars 51 forks source link

Simplest cannot be compiled #60

Closed loxal closed 8 years ago

loxal commented 8 years ago

When I compile my really simple & plain example project, I get this

✔ ~/my/project/loxal/bugvm-template-project [master|●71✚ 18…2] 
16:47 $ gradle clean build createIPA launchIPhoneSimulator 
:clean
:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
/Users/alex/my/project/loxal/bugvm-template-project/src/main/java/net/loxal/example/ios/HelloWorld.java:27: error: cannot access ObjCProtocol
public class HelloWorld extends UIApplicationDelegateAdapter {
       ^
  class file for com.bugvm.objc.ObjCProtocol not found
/Users/alex/my/project/loxal/bugvm-template-project/src/main/java/net/loxal/example/ios/view/RootViewController.java:27: error: cannot access ObjCObject
public class RootViewController extends UIViewController {
       ^
  class file for com.bugvm.objc.ObjCObject not found
warning: Supported source version 'RELEASE_6' from annotation processor 'org.sonatype.guice.bean.scanners.index.SisuIndexAPT6' less than -source '1.7'
/Users/alex/my/project/loxal/bugvm-template-project/src/main/java/net/loxal/example/ios/HelloWorld.java:30: error: method main in class UIApplication cannot be applied to given types;
        UIApplication.main(args, null, HelloWorld.class);
                     ^
  required: String[],Class<P>,Class<D>
  found: String[],<null>,Class<HelloWorld>
  reason: inference variable D has incompatible upper bounds NSObject,UIApplicationDelegate
  where P,D are type-variables:
    P extends UIApplication declared in method <P,D>main(String[],Class<P>,Class<D>)
    D extends NSObject,UIApplicationDelegate declared in method <P,D>main(String[],Class<P>,Class<D>)
/Users/alex/my/project/loxal/bugvm-template-project/src/main/java/net/loxal/example/ios/HelloWorld.java:34: error: method does not override or implement a method from a supertype
    @Override
    ^
/Users/alex/my/project/loxal/bugvm-template-project/src/main/java/net/loxal/example/ios/HelloWorld.java:37: error: incompatible types: RootViewController cannot be converted to UIViewController
        window.setRootViewController(new RootViewController());
                                     ^
/Users/alex/my/project/loxal/bugvm-template-project/src/main/java/net/loxal/example/ios/view/RootViewController.java:31: error: cannot find symbol
        final UIView view = getView();
                            ^
  symbol:   method getView()
  location: class RootViewController
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
4 errors
1 warning
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

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

BUILD FAILED

Total time: 3.603 secs
ibinti commented 8 years ago

your linked example refers to robovm, not bugvm

loxal commented 8 years ago

@ibinti sorry, IntelliJ swallowed my commit, now it should refer to BugVM.

ibinti commented 8 years ago

error message says class file for com.bugvm.objc.* not found.

Adding dependency compile "com.bugvm:bugvm-objc:1.1.0" solved the issue when I tested your example project.

loxal commented 8 years ago

Thanks, it works now. It would be nice to have a “Hello, World” reference project for BugVM, so this kind of runtime issues can be made obvious by looking at a simple reference project.

I just created such a reference project: https://github.com/loxal/bugvm-example-template-project This project was a RoboVM reference project before.

ibinti commented 8 years ago

In fact, BugVM Studio has a new project template that is supposed to be used as a reference project.