{"action":"created","issue":{"url":"https://api.github.com/repos/robolectric/robolectric/issues/2143","labels_url":"https://api.github.com/repos/robolectric/robolectric/issues/2143/labels{/name}","comments_url":"https://api.github.com/repos/robolectric/robolectric/issues/2143/comments","events_url":"https://api.github.com/repos/robolectric/robolectric/issues/2143/events","html_url":"https://github.com/robolectric/robolectric/issues/2143","id":116773430,"number":2143,"title":"Not compatible with android plugin 1.5.0's data binding","user":{"login":"brianguertin","id":120002,"avatar_url":"https://avatars.githubusercontent.com/u/120002?v=3","gravatar_id":"","url":"https://api.github.com/users/brianguertin","html_url":"https://github.com/brianguertin","followers_url":"https://api.github.com/users/brianguertin/followers","following_url":"https://api.github.com/users/brianguertin/following{/other_user}","gists_url":"https://api.github.com/users/brianguertin/gists{/gist_id}","starred_url":"https://api.github.com/users/brianguertin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianguertin/subscriptions","organizations_url":"https://api.github.com/users/brianguertin/orgs","repos_url":"https://api.github.com/users/brianguertin/repos","events_url":"https://api.github.com/users/brianguertin/events{/privacy}","received_events_url":"https://api.github.com/users/brianguertin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-13T14:01:52Z","updated_at":"2015-12-10T22:47:50Z","closed_at":null,"body":"I'm using Robolectric 3.0 with the Android gradle plugin v1.5.0, with data binding enabled via:\r\n```groovy\r\nandroid {\r\n  dataBinding {\r\n    enabled = true\r\n  }\r\n}\r\n```\r\nhttp://developer.android.com/tools/data-binding/guide.html\r\n\r\nHowever, when trying to inflate any XML file that has `<layout>` as a top-level element, I get this error:\r\n```\r\nandroid.view.InflateException: XML file build/intermediates/res/merged/debug/layout/account.xml line #-1 (sorry, not yet implemented): Error inflating class layout\r\n\tat android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:757)\r\n\tat android.view.LayoutInflater.inflate(LayoutInflater.java:482)\r\n\tat android.view.LayoutInflater.inflate(LayoutInflater.java:414)\r\n\tat android.view.LayoutInflater.inflate(LayoutInflater.java:365)\r\n\tat android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257)\r\n\tat android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)\r\n\tat android.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:276)\r\n\tat android.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:261)\r\n\tat com.example.activities.AccountActivity.onCreate(AccountActivity.java:46)\r\n\tat android.app.Activity.performCreate(Activity.java:5933)\r\n\tat org.robolectric.util.ReflectionHelpers.callInstanceMethod(ReflectionHelpers.java:195)\r\n\tat org.robolectric.util.ActivityController$1.run(ActivityController.java:122)\r\n\tat org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:304)\r\n\tat org.robolectric.shadows.CoreShadowsAdapter$2.runPaused(CoreShadowsAdapter.java:45)\r\n\tat org.robolectric.util.ActivityController.create(ActivityController.java:118)\r\n\tat org.robolectric.util.ActivityController.create(ActivityController.java:129)\r\n\tat org.robolectric.util.ActivityController.setup(ActivityController.java:210)\r\n\tat com.example.test.AccountActivityTest.setup(AccountActivityTest.java:35)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\r\n\tat org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)\r\n\tat org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)\r\n\tat org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:251)\r\n\tat org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:188)\r\n\tat org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:54)\r\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\r\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\r\n\tat org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:152)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\r\n\tat org.junit.runner.JUnitCore.run(JUnitCore.java:137)\r\n\tat com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)\r\nCaused by: java.lang.ClassNotFoundException: android.view.layout\r\n\tat org.robolectric.internal.bytecode.InstrumentingClassLoader.getByteCode(InstrumentingClassLoader.java:168)\r\n\tat org.robolectric.internal.bytecode.InstrumentingClassLoader.findClass(InstrumentingClassLoader.java:123)\r\n\tat org.robolectric.internal.bytecode.InstrumentingClassLoader.loadClass(InstrumentingClassLoader.java:95)\r\n\tat android.view.LayoutInflater.createView(LayoutInflater.java:571)\r\n\tat android.view.LayoutInflater.onCreateView(LayoutInflater.java:665)\r\n\tat org.robolectric.shadows.RoboLayoutInflater.onCreateView(RoboLayoutInflater.java:51)\r\n\tat android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)\r\n\tat android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)\r\n```\r\n\r\nIt appears robolectric is trying to inflate the `<layout>` tag as if it were a custom view class."},"comment":{"url":"https://api.github.com/repos/robolectric/robolectric/issues/comments/163776528","html_url":"https://github.com/robolectric/robolectric/issues/2143#issuecomment-163776528","issue_url":"https://api.github.com/repos/robolectric/robolectric/issues/2143","id":163776528,"user":{"login":"yigit","id":89202,"avatar_url":"https://avatars.githubusercontent.com/u/89202?v=3","gravatar_id":"","url":"https://api.github.com/users/yigit","html_url":"https://github.com/yigit","followers_url":"https://api.github.com/users/yigit/followers","following_url":"https://api.github.com/users/yigit/following{/other_user}","gists_url":"https://api.github.com/users/yigit/gists{/gist_id}","starred_url":"https://api.github.com/users/yigit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yigit/subscriptions","organizations_url":"https://api.github.com/users/yigit/orgs","repos_url":"https://api.github.com/users/yigit/repos","events_url":"https://api.github.com/users/yigit/events{/privacy}","received_events_url":"https://api.github.com/users/yigit/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T22:47:50Z","updated_at":"2015-12-10T22:47:50Z","body":"Looks like Robolectric is not reading the correct merged resource directory. \r\nDataBinding updates merge resources target directory so that it can inject an incremental task to update layout files. Seems like Robolectric is reading the previous version.\r\n\r\nThis behavior is changed in Android Gradle Plugin 1.5. Before that, DataBinding would override the layout files so Robolectric was working fine but that behavior breaks incremental merge resources task.\r\n\r\nThe new location is this:\r\nbuild/intermediates/data-binding-layout-out\r\n\r\nBut it may change any time so Robolectric should be reading it from the AndroidModel (if it is not doing so already).\r\n"}}