震惊!build.gradle里compile换行不正确竟然会

2017-03-16 遇到的一点小问题
今天Android Studio里项目莫名其妙提示

Error:Could not get unknown property 'compile' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Gradle 'Wannoo' project refresh failed

《震惊!build.gradle里compile换行不正确竟然会》 Gradle失败

《震惊!build.gradle里compile换行不正确竟然会》 Message提示信息

没记起改过什么,只好网上搜索看看。还好,
网上很多答案

Just Change your line breaks , it will solve your problem很简单,就是修改一下
build.gradle里的换行。修改后果然正常了,好奇葩的问题啊,记录一下。

《震惊!build.gradle里compile换行不正确竟然会》 compile换行不正确

《震惊!build.gradle里compile换行不正确竟然会》 compile正确换行

Space
xml中为了性能,占位用基本是使用Space不用View,因为它只计算位置尺寸,不进行draw操作。不过因此也只能占位,连设置颜色都不管用。而且它默认为INVISIBLE

public Space(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        if (getVisibility() == VISIBLE) {
              setVisibility(INVISIBLE);
        }
}
    原文作者:苍蝇的梦
    原文地址: https://www.jianshu.com/p/55cd77e91e64
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞