MainActivity.kt
package com.example.diceroller
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:layout_gravity="center_horizontal"
android:textSize="30sp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/roll"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
strings.xml
<resources>
<string name="app_name">Dice roller</string>
<string name="roll">Roll</string>
</resources>
При запуске:
Installation did not succeed.
The application could not be installed.
List of apks:
[0] 'C:\Users\Maxim\AndroidStudioProjects\Diceroller\app\build\outputs\apk\debug\app-debug.apk'
Installation failed due to: ''cmd package install-create -r -t --user current --full --dont-kill -S 3208706' returns error 'Unknown failure: cmd: Can't find service: package''