Код: Выделить всё
Код: Выделить всё
public class MainActivity extends AppCompatActivity {
private FloatingActionButton mFab;
private TextView mTxtMsg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTxtMsg = (TextView) findViewById(R.id.txtMsg);
mFab = (FloatingActionButton) findViewById(R.id.fab);
mFab.setOnClickListener(mFabOnClick);
}
private View.OnClickListener mFabOnClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
mTxtMsg.setText("You press a FAB button!");
}
};
}
Код: Выделить всё
dependencies {
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation ("androidx.coordinatorlayout:coordinatorlayout:1.2.0") // This is the new line I add.
}
Код: Выделить всё
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "Test"
include(":app")

Моя версия студии Android — 2024.1.2 Patch2 .
В чем проблема? Как это исправить?
В чем проблема? Как мне это исправить?
Подробнее здесь: https://stackoverflow.com/questions/790 ... ript-error
Мобильная версия