Guest User

Untitled

a guest
Nov 20th, 2017
529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
  2. > android.databinding.tool.util.LoggedErrorException: Found data binding errors.
  3. ****/ data binding error ****msg:Identifiers must have user defined types from the XML file. viewmodel is missing it
  4. file:C:UsersjacopDocumentsandroidprojectscarBookappsrcmainreslayoutactivity_main.xml
  5. loc:18:24 - 18:32
  6. **** data binding error ****
  7.  
  8. public class MainActivity extends AppCompatActivity implements LifecycleOwner {
  9.  
  10. public MainViewModel viewModel;
  11.  
  12. public class MainViewModel extends ViewModel {
  13.  
  14. private LatLng origin;
  15.  
  16. public LatLng getOrigin() {
  17. return origin;
  18. }
  19.  
  20. <layout xmlns:android="http://schemas.android.com/apk/res/android"
  21. xmlns:tools="http://schemas.android.com/tools"
  22. tools:context="jacopo.com.gpspath.MainActivity">
  23. <data>
  24. <variable name="viewModel" type="jacopo.com.carbook.MainViewModel" />
  25. </data>
  26. <TextView
  27. android:id="@+id/text"
  28. android:layout_width="wrap_content"
  29. android:layout_height="wrap_content"
  30. android:text="@{viewModel.origin.latitude}"/>
  31. </layout
Add Comment
Please, Sign In to add comment