Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了无法在android studio Gradle中编译项目:无效符号:’switch’大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用 Android studio来编译项目. Project min SDK为14,目标为17.

我正在使用此代码.

<RelativeLayout xmlns:android="http://scheR_520_11845@as.android.com/apk/res/android"
    xmlns:tools="http://scheR_520_11845@as.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context=".MainActivity">


        <Switch
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="New Switch"
            android:id="@+id/switch" android:layout_alignBottom="@+id/button3" android:layout_toRightOf="@+id/button3"
            android:layout_marginLeft="44dp"/>


</RelativeLayout>

解决方法

如果您将交换机的ID更改为“@ id / switch”以外的其他内容,则可以解决错误.例如:
<Switch
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="New Switch"
            android:id="@+id/Switch"
            android:layouT_Below="@+id/Switch"
            android:layout_alignLeft="@+id/Switch"/>

将是一个有效的开关.

来源:https://code.google.com/p/android/issues/detail?id=55720

大佬总结

以上是大佬教程为你收集整理的无法在android studio Gradle中编译项目:无效符号:’switch’全部内容,希望文章能够帮你解决无法在android studio Gradle中编译项目:无效符号:’switch’所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。