{"action":"created","issue":{"url":"https://api.github.com/repos/mmin18/FlexLayout/issues/4","repository_url":"https://api.github.com/repos/mmin18/FlexLayout","labels_url":"https://api.github.com/repos/mmin18/FlexLayout/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/mmin18/FlexLayout/issues/4/comments","events_url":"https://api.github.com/repos/mmin18/FlexLayout/issues/4/events","html_url":"https://github.com/mmin18/FlexLayout/issues/4","id":147959982,"number":4,"title":"Setting views relative to another view","user":{"login":"chiragpurohit71085","id":15859081,"avatar_url":"https://avatars.githubusercontent.com/u/15859081?v=3","gravatar_id":"","url":"https://api.github.com/users/chiragpurohit71085","html_url":"https://github.com/chiragpurohit71085","followers_url":"https://api.github.com/users/chiragpurohit71085/followers","following_url":"https://api.github.com/users/chiragpurohit71085/following{/other_user}","gists_url":"https://api.github.com/users/chiragpurohit71085/gists{/gist_id}","starred_url":"https://api.github.com/users/chiragpurohit71085/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chiragpurohit71085/subscriptions","organizations_url":"https://api.github.com/users/chiragpurohit71085/orgs","repos_url":"https://api.github.com/users/chiragpurohit71085/repos","events_url":"https://api.github.com/users/chiragpurohit71085/events{/privacy}","received_events_url":"https://api.github.com/users/chiragpurohit71085/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-13T06:30:41Z","updated_at":"2016-04-13T14:39:47Z","closed_at":null,"body":"Hi\r\n\r\nWhen I am trying to set views relatively to each other I a getting following error. I have taken care of defining references view first.\r\n\r\nI am using Android studio 2.0. I am facing this issue in my demo app as well as sample app along with this library.\r\n\r\n(Reference a specific view using view's id)\r\n\r\njava.lang.IllegalArgumentException: unknown identifier view2, layout_top=view2.bottom+20dp\r\n\tat com.github.mmin18.widget.FlexLayout$TokenReader.parseStr(FlexLayout.java:1334)\r\n\tat com.github.mmin18.widget.FlexLayout$TokenReader.readToken(FlexLayout.java:1286)\r\n\tat com.github.mmin18.widget.FlexLayout$RPN.parse(FlexLayout.java:1420)\r\n\tat com.github.mmin18.widget.FlexLayout$LayoutParams.<init>(FlexLayout.java:78)\r\n\tat com.github.mmin18.widget.FlexLayout.generateLayoutParams(FlexLayout.java:325)\r\n\tat com.github.mmin18.widget.FlexLayout.generateLayoutParams(FlexLayout.java:32)\r\n\tat android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:837)\r\n\tat android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)\r\n\tat android.view.LayoutInflater.rInflate(LayoutInflater.java:811)\r\n\tat android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)\r\n\tat android.view.LayoutInflater.inflate(LayoutInflater.java:515)\r\n\tat android.view.LayoutInflater.inflate(LayoutInflater.java:394)\r\n\tat com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:229)\r\n\tat com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:426)\r\n\tat com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)\r\n\tat com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:510)\r\n\tat com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:498)\r\n\tat com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:967)\r\n\tat com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:498)\r\n\tat com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)\r\n\tat com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:610)\r\n\tat com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:607)\r\n\tat com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:359)\r\n\tat com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:607)\r\n\tat com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:629)\r\n\tat com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$7.run(AndroidDesignerEditorPanel.java:519)\r\n\tat com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)\r\n\tat com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)\r\n\tat com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:271)\r\n\tat com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:286)\r\n\tat com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:244)\r\n\tat com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:234)\r\n\tat com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)\r\n\tat com.intellij.util.Alarm$Request$1.run(Alarm.java:352)\r\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)\r\n\tat java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:138)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)\r\n\tat java.lang.Thread.run(Thread.java:695)\r\n\r\n\r\nHere is my sample XML file...\r\n\r\n\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<com.github.mmin18.widget.FlexLayout\r\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\">\r\n\r\n    <Button\r\n        app:layout_width=\"(152/3.84)%\"\r\n        app:layout_height=\"(64/5.70)%\"\r\n        android:text=\"New Button\"\r\n        android:id=\"@+id/button\"\r\n        app:layout_centerX=\"50%\"\r\n\r\n        app:layout_top=\"(73.68%)\"/>\r\n\r\n    <ImageView\r\n\r\n        app:layout_width=\"(116/3.84)%\"\r\n        app:layout_height=\"(94/5.70)%\"\r\n        app:layout_top=\"(25/5.70)%\"\r\n        app:layout_left=\"0dp\"\r\n        android:id=\"@+id/imageView2\"\r\n        android:background=\"@color/abc_search_url_text_pressed\"/>\r\n\r\n    <TextView\r\n        android:id=\"@+id/view2\"\r\n        app:layout_width=\"(244/3.84)%\"\r\n        app:layout_height=\"(32/5.70)%\"\r\n        android:text=\"New Text1\"\r\n        app:layout_left=\"(122/3.84)%\"\r\n        app:layout_top=\"(32/5.70)%\"/>\r\n\r\n\r\n    <TextView\r\n        android:id=\"@+id/textView3\"\r\n        android:layout_width=\"244dp\"\r\n        android:layout_height=\"32dp\"\r\n        android:text=\"New Text\"\r\n        app:layout_centerX=\"view2.centerX\"\r\n        app:layout_top=\"view2.bottom+20dp\"\r\n\r\n        />\r\n\r\n</com.github.mmin18.widget.FlexLayout>\r\n\r\n\r\nLet me know if I am missing anything.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mmin18/FlexLayout/issues/comments/209478688","html_url":"https://github.com/mmin18/FlexLayout/issues/4#issuecomment-209478688","issue_url":"https://api.github.com/repos/mmin18/FlexLayout/issues/4","id":209478688,"user":{"login":"mmin18","id":748883,"avatar_url":"https://avatars.githubusercontent.com/u/748883?v=3","gravatar_id":"","url":"https://api.github.com/users/mmin18","html_url":"https://github.com/mmin18","followers_url":"https://api.github.com/users/mmin18/followers","following_url":"https://api.github.com/users/mmin18/following{/other_user}","gists_url":"https://api.github.com/users/mmin18/gists{/gist_id}","starred_url":"https://api.github.com/users/mmin18/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmin18/subscriptions","organizations_url":"https://api.github.com/users/mmin18/orgs","repos_url":"https://api.github.com/users/mmin18/repos","events_url":"https://api.github.com/users/mmin18/events{/privacy}","received_events_url":"https://api.github.com/users/mmin18/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T14:39:46Z","updated_at":"2016-04-13T14:39:46Z","body":"It works fine on my side. Can you checkout the branch https://github.com/mmin18/FlexLayout/tree/tmp/test_chiragpurohit71085 and see if it works on your phone?\r\n\r\nI've changed gradle build tool to 2.0.0, and I'm also using AndroidStudio 2.0\r\n\r\n![device-2016-04-13-223528](https://cloud.githubusercontent.com/assets/748883/14497134/5c355f9e-01c8-11e6-908a-92a4130d9416.png)"}}