Answer the question
In order to leave comments, you need to log in
Why did the compilation error occur?
When compiling the apk file, an error appeared
5:08 Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view.
Looked in 'messages' The
question is what to do?
Just in case, code:
package com.example.user.gey;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
public class activity_main {
}
public class MainActivity extends AppCompatActivity{
Button bt;
@Override
protected void OnCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bt = (Button)findViewById(R.id.find);
final MediaPlayer mp = MediaPlayer.create (this, R.raw.old) ;
bt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mp.start();
}
});
<?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">
<Button
android:id="@+id/button"
style="@android:style/Widget.Material.Light.Button.Borderless.Colored"
android:layout_width="207dp"
android:layout_height="107dp"
android:background="@drawable/russia"
android:text="Спугнуть педераста"
tools:layout_editor_absoluteX="78dp"
tools:layout_editor_absoluteY="63dp" />
<Button
android:id="@+id/find"
android:layout_width="219dp"
android:layout_height="101dp"
android:background="@drawable/gey"
android:text="Button"
tools:layout_editor_absoluteX="71dp"
tools:layout_editor_absoluteY="194dp"
tools:text="Найти п*идора" />
<TextView
android:id="@+id/textView"
android:layout_width="137dp"
android:layout_height="41dp"
android:text="Хелоу, епта"
tools:layout_editor_absoluteX="122dp"
tools:layout_editor_absoluteY="16dp" />
</android.support.constraint.ConstraintLayout>
Answer the question
In order to leave comments, you need to log in
Execution exception usually occurs if the callable thread ends with an exception
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question