These are chat archives for Arasthel/SwissKnife

25th
Jul 2015
Ryan Vanderwerf
@rvanderwerf
Jul 25 2015 05:26
hi there
messing with Swissknife on a wear app, running into weird problems
I tried just a basic use of the wear app in the swissknife to inject a view it it seems to be null
I have another app that is working, but if I add 'SwissKnife.inject this' and no other use of SwissKnife annotations it crashes with this: Caused by: groovy.lang.MissingMethodException: No signature of method: com.tutosandroidfrance.wearsample.MainActivity.injectViews() is applicable for argument types: (com.tutosandroidfrance.wearsample.MainActivity) values: [com.tutosandroidfrance.wearsample.MainActivity@133ab8db]
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.arasthel.swissknife.SwissKnife.inject(SwissKnife.groovy:40)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:151)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:91)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.tutosandroidfrance.wearsample.MainActivity.onCreate(MainActivity.groovy:45)
Eugene Kamenev
@eugene-kamenev
Jul 25 2015 05:29
Arasthel/SwissKnife#37
I will check this in an hour, just had a breakfast :)
Ryan Vanderwerf
@rvanderwerf
Jul 25 2015 05:30
heh thanks man. I'm new to SN so maybe I am just setting up something wrong, but I figured I'd start with a most basic case with the sample before I try anything fancy :)
Eugene Kamenev
@eugene-kamenev
Jul 25 2015 05:34
Maybe :) we didn't run wear app for a long time. So your app crashes on run, not on build as I see?
Ryan Vanderwerf
@rvanderwerf
Jul 25 2015 05:45
yes when I step through the debugger, as soon as I run the SwissKnife inject this it completely crashes with that exception. If I try to inject views, they are null as well (although not sure if inject must be called first). I'll post that project up on my git page later. I'm trying to demonstrate 'groovyifying' an regular wear app with SwissKnife and some other tools so show how much cleaner it will look :)
that when I went back to the example in the project itself and just tried the basic stuff for a sanity check
Eugene Kamenev
@eugene-kamenev
Jul 25 2015 06:48
@rvanderwerf the most strange thing is that it cant find view even through default methods, you can try it yourself :) findViewById(R.id.text) gives null.
Ryan Vanderwerf
@rvanderwerf
Jul 25 2015 06:55
oh that is weird. Maybe it needs context to the watchstub first?
Eugene Kamenev
@eugene-kamenev
Jul 25 2015 07:01
check your issue please, more info there
Ryan Vanderwerf
@rvanderwerf
Jul 25 2015 07:04
cool thanks for checking it out. I didn't make that example in there, so I'm not sure either. I had trouble doing much with it so I was trying it on another app I knew more about.
Eugene Kamenev
@eugene-kamenev
Jul 25 2015 07:44
@rvanderwerf by the way you can simply find views by calling extension method view(int id) anywhere :)
Ryan Vanderwerf
@rvanderwerf
Jul 25 2015 07:51
nice
I opened #38 with a real project. Would be cool if I could show off SN working in wear next week at gr8conf :) Going to sleep now 3am here :)