{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/litho/issues/366","repository_url":"https://api.github.com/repos/facebook/litho","labels_url":"https://api.github.com/repos/facebook/litho/issues/366/labels{/name}","comments_url":"https://api.github.com/repos/facebook/litho/issues/366/comments","events_url":"https://api.github.com/repos/facebook/litho/issues/366/events","html_url":"https://github.com/facebook/litho/issues/366","id":325198692,"number":366,"title":"InstrumentalTests: Unresolved reference: create ","user":{"login":"just-kip","id":4008338,"avatar_url":"https://avatars2.githubusercontent.com/u/4008338?v=4","gravatar_id":"","url":"https://api.github.com/users/just-kip","html_url":"https://github.com/just-kip","followers_url":"https://api.github.com/users/just-kip/followers","following_url":"https://api.github.com/users/just-kip/following{/other_user}","gists_url":"https://api.github.com/users/just-kip/gists{/gist_id}","starred_url":"https://api.github.com/users/just-kip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/just-kip/subscriptions","organizations_url":"https://api.github.com/users/just-kip/orgs","repos_url":"https://api.github.com/users/just-kip/repos","events_url":"https://api.github.com/users/just-kip/events{/privacy}","received_events_url":"https://api.github.com/users/just-kip/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-22T08:53:59Z","updated_at":"2018-05-22T09:10:28Z","closed_at":null,"author_association":"NONE","body":"- [x] I have searched [existing issues](https://github.com/facebook/litho/issues) and this is not a duplicate\r\n\r\n## Version\r\n```\r\next {\r\n    screenshotTestVersion = '0.6.0'\r\n    kotlinVersion = '1.2.41'\r\n    litho = '0.15.0'\r\n}\r\n```\r\n\r\n## Issues and Steps to Reproduce\r\nI create test according to https://github.com/facebook/screenshot-tests-for-android/blob/master/sample/src/androidTest/java/com/facebook/testing/screenshot/sample/ExampleScreenshotTest.java\r\n```\r\ne: ../app/src/androidTest/java/kt/test/instrumental/screenshots/specs/TestLandingSpec.kt: (26, 33): Unresolved reference: create\r\n:kt-app:compileDevStagingAndroidTestKotlin FAILED\r\n```\r\n## Link to Code\r\nSpec\r\n```\r\n@LayoutSpec\r\nobject LandingSpec {\r\n\r\n    @OnCreateLayout\r\n    fun onCreateLayout(context: ComponentContext) : Component {\r\n        return Row\r\n                .create(context)\r\n                .backgroundRes(R.color.color_white)\r\n                .widthPercent(100f)\r\n                .heightPercent(100f)\r\n                .child(\r\n                        Image.create(context)\r\n                                .drawableRes(R.drawable.ic_splash_screen)\r\n                )\r\n                .justifyContent(YogaJustify.CENTER)\r\n                .alignItems(YogaAlign.CENTER)\r\n                .build()\r\n    }\r\n}\r\n```\r\n\r\nTest\r\n```\r\nclass TestLandingSpec {\r\n\r\n    @Test\r\n    fun testLanding() {\r\n        val context = InstrumentationRegistry.getInstrumentation().targetContext\r\n\r\n        val li = LayoutInflater.from(context)\r\n\r\n        val lithoView = li.inflate(R.layout.test_litho_view, null, false) as LithoView\r\n\r\n        val component = Landing.create(lithoView.componentContext).build()\r\n\r\n        lithoView.setComponent(component)\r\n\r\n        ViewHelpers.setupView(lithoView).setExactWidthDp(360).setExactHeightDp(640).layout()\r\n        Screenshot.snap(lithoView).record()\r\n    }\r\n}\r\n```\r\nBut it works when:\r\n- i create component without generated code\r\n```val component = LandingSpec.onCreateLayout(lithoView.componentContext)```\r\n- i create screenshot of whole activity with this component\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/litho/issues/comments/390919321","html_url":"https://github.com/facebook/litho/issues/366#issuecomment-390919321","issue_url":"https://api.github.com/repos/facebook/litho/issues/366","id":390919321,"user":{"login":"pavlospt","id":1070871,"avatar_url":"https://avatars1.githubusercontent.com/u/1070871?v=4","gravatar_id":"","url":"https://api.github.com/users/pavlospt","html_url":"https://github.com/pavlospt","followers_url":"https://api.github.com/users/pavlospt/followers","following_url":"https://api.github.com/users/pavlospt/following{/other_user}","gists_url":"https://api.github.com/users/pavlospt/gists{/gist_id}","starred_url":"https://api.github.com/users/pavlospt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavlospt/subscriptions","organizations_url":"https://api.github.com/users/pavlospt/orgs","repos_url":"https://api.github.com/users/pavlospt/repos","events_url":"https://api.github.com/users/pavlospt/events{/privacy}","received_events_url":"https://api.github.com/users/pavlospt/received_events","type":"User","site_admin":false},"created_at":"2018-05-22T09:10:28Z","updated_at":"2018-05-22T09:10:28Z","author_association":"CONTRIBUTOR","body":"@just-kip That seems to be correct, do you have a reproducing repo where we can check it? :)"}}
{"actor":{"display_login":"pavlospt"}}