Android

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

2017-03-16  本文已影响385人  苍蝇的梦

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
Gradle失败
Message提示信息
没记起改过什么,只好网上搜索看看。还好,网上很多答案
Just Change your line breaks , it will solve your problem很简单,就是修改一下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);
        }
}
上一篇下一篇

猜你喜欢

热点阅读