What is Migrate Android Code?

后端 未结 2 946
既然无缘
既然无缘 2021-01-15 01:24

As of ADT 14, resource fields cannot be used as switch cases. Invoke this fix to get more information. whats the reason this is used for?

相关标签:
2条回答
  • 2021-01-15 01:48

    Take a look at the official blog post about this:

    http://tools.android.com/recent/switchstatementconversion

    http://tools.android.com/tips/non-constant-fields

    Basically, resource constants in library projects are no longer "final". From the ADT Site:

    In other words, the constants are not final in a library project. The reason for this is simple: When multiple library projects are combined, the actual values of the fields (which must be unique) could collide. Before ADT 14, all fields were final, so as a result, all libraries had to have all their resources and associated Java code recompiled along with the main project whenever they were used. This was bad for performance, since it made builds very slow. It also prevented distributing library projects that didn't include the source code, limiting the usage scope of library projects.

    0 讨论(0)
  • 2021-01-15 02:04

    For all of those who didn't resolve this problem yet - this is what i`v done:

    1. Go to your "project.properties" file.
    2. Delete this line " android.library=true"

    The reason why i had this problem, was because i did a copy&paste the properties file into my project (was missing).

    cheers.

    0 讨论(0)
提交回复
热议问题