我想flavorDimensions
在我的应用程序 gradle 中构建版本应用程序,如下所示
androidExtensions {
experimental = true
}
flavorDimensions "version", "a"
productFlavors {
yooooo {
dimension "version"
}
hei {
dimension "version"
}
six {
dimension "a"
}
fsdf {
dimension "a"
}
}
当我运行我的应用程序时,出现此错误
e: /Users/wanbo/Dev/Android/workspace/me/test/app/src/yooooo/java/com/werb/test/MainActivity.kt: (12, 9): Unresolved reference: tttt
在使用 android 扩展的活动中找不到我的视图
我的活动代码
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.yooooo.activity_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
tttt.text = "2222"
}}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/tttt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />