My Android app is not working on the device
my android app is up and running fine. Then I put the font family in styles, changed the API level. But it didn't work.
So, I removed the font family from the styles, tried to downgrade the API, but something went wrong and the application can currently be installed but does not work.
I tried to find a similar problem here, but I was unsuccessful and maybe made the app even worse :(
I am really young and I only started writing two months ago, so please send me a detailed description of how to fix this problem.
My device API is 15
Here is my build.gradle -
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.ondra.dejepisno_zemepisnymilionar"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'com.google.android.gms:play-services-vision:9.4.0+'
testCompile 'junit:junit:4.12'
}
Android manifest -
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ondra.dejepisno_zemepisnymilionar">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:configChanges="orientation"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
My styles.xml -
<resources>
<!-- Base application theme. -->
<style
name="AppTheme"
parent="android:Theme.Light.NoTitleBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textViewStyle">@style/TextViewStyle</item>
<item name="android:buttonStyle">@style/ButtonStyle</item>
</style>
<style name="TextViewStyle" parent="android:Widget.TextView">
</style>
<style name="ButtonStyle" parent="android:Widget.Button">
</style>
</resources>
I would be very grateful for any answer that might help me, because I've already spent about 20 hours looking for a solution or trying to fix the application, but unfortunately nothing worked: /
UPDATE - log - My log
UPDATE 2
I am using more layouts for my main activity, but this is the first layout in the On Create method.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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="com.example.ondra.dejepisno_zemepisnymilionar.MainActivity"
android:background="@drawable/menu2">
<Button
android:id="@+id/novahra"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NOVÁ HRA"
android:layout_marginTop="131dp"
android:layout_alignParentTop="true"
android:layout_alignLeft="@+id/ovyvojari"
android:layout_alignRight="@+id/ovyvojari" />
<Button
android:id="@+id/ovyvojari"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="O VÝVOJÁŘI"
android:layout_marginTop="31dp"
android:layout_below="@+id/bhighscore"
android:layout_alignLeft="@+id/specialnipodekovani"
android:layout_alignRight="@+id/specialnipodekovani" />
<Button
android:id="@+id/specialnipodekovani"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="22dp"
android:text="SPECIÁLNÍ PODĚKOVÁNÍ"
android:layout_below="@+id/ovyvojari"
android:layout_centerHorizontal="true" />
<Button
android:id="@+id/bhighscore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="27dp"
android:text="HIGH SCORE"
android:layout_below="@+id/novahra"
android:layout_alignLeft="@+id/novahra"
android:layout_alignStart="@+id/novahra"
android:layout_alignRight="@+id/ovyvojari"
android:layout_alignEnd="@+id/ovyvojari" />
</RelativeLayout>
source to share