Android: Installed application hasn't icon on the main screen - android

I have a simple Android app (Android Studio wizard - Basic Activity). After compilation and installation it successfully runs on my device. But it doesn't have an icon on the main screen (even like as Android default icon)! And as result I can't relaunch application.
How to resolve this problem?
Apps installed from the Google Play has an icons - it's OK.
I tested several devices, and the problem occurs only on one device - Hisense A6 (with dual screens - AMOLED and e-ink on back side).
UPD (07.02.2020): After my investigation I figured out that signed applications installed successfully with icons on main screen!
Android settings: Developer mode, Verify apps over USB (Check apps installed via ADB/ADT) - is OFF
Android 9.0
Phone model: Hisense A6 (HLTE700E)
Build version: PKQ1.181105.001
MainActivity.kt:
package com.apps.myapplication
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)
}
}
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.apps.myapplication">
<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">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.apps.myapplication"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

After my investigations I figured out that signed applications installed successfully with icons on main screen.
I think it is a feature of this one phone.

Related

Android Studio 3.2 - Instant Run performed a full build and install since the installation on the device does not match the local build on disk

I was following this tutorial from youtube to learn to make an android keyboard. I followed everything as described in it. I was able to build the project succesfully but whenever I try to run it I was getting the following error -
Instant Run performed a full build and install since the installation on the device does not match the local build on disk
So I googled for a solution and tried turning off Instant Run, then the above mentioned error was not appearing. The APK was installed to my device, but when I tried to enable the keyboard in the settings it was not found there. I tried it in device and 2 emulators, but problem is same everywhere.
I don't know what to do. I will copy my Android Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tomsapp.keeskeyboard">
<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">
<service
android:name=".KeesKeyboard"
android:label="#string/app_name"
android:permission="android:permission.BIND_INPUT_METHOD">
<meta-data android:name="android.view.im" android:resource="#xml/method"/>
<intent-filter>
<action android:name="android.view.InputMethod"/>
</intent-filter>
</service>
</application>
and Build Gradle file here:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.tomsapp.keeskeyboard"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Please point out what I am doing wrong here.
In your build.Gradle file set minSDK to 22n so it matches your android vertual device.
If there is an image view in your app then place that image Corresponding to image view in the drawable folder. Don't keep it in drawable -v24 folder and run on your device it may work

Having compatibility issues on Google Play with some devices

I've recently just launched my app, and it's going really well! I am having issues with some users, though. Users on older devices such as the Nexus 5X, Huawei P10 Lite, and Meizu M2 Note are saying they are unable to download the app on Google Play because it says it is incompatible with their device. I've already checked the Developer Console and it says the app should support these devices (except the Meizu that one doesn't even show up in the catalog). I've also already run emulators mimicking the devices and everything works fine. All of them are running Android 8.0 which I know for sure is supported by my app.
I've been looking all over google for a way to solve this, but honestly I have no idea what to do anymore. This is my first real app and I can't help but get the feeling that I'm missing some crucial step for widespread release.
Here's my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.balanstudios.einar.workouttimer">
<uses-permission android:name="android.permission.VIBRATE" />
<uses-feature android:name="android.hardware.vibrate" android:required="false"></uses-feature>
<application
android:name=".BaseApp"
android:allowBackup="true"
android:icon="#mipmap/ic_work_icon_small"
android:label="Robota"
android:roundIcon="#mipmap/ic_work_icon_small_round"
android:supportsRtl="true"
android:theme="#style/WorkoutTimerLight">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:theme="#style/WorkoutTimerLight"
android:windowSoftInputMode="adjustPan">
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
<activity android:name=".SplashScreen"
android:screenOrientation="portrait"
android:theme="#style/WorkoutTimerLight"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity>
</application>
</manifest>
Here's my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.balanstudios.einar.workouttimer"
minSdkVersion 23
targetSdkVersion 28
versionCode 7
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support:support-media-compat:28.0.0-alpha3'
implementation 'com.android.support:design:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:28.0.0-alpha3'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Does anyone have any ideas? I would really appreciate any help!
Play Store Link
Your app has min Sdk = 23 (this gradle line)
minSdkVersion 23
The complaints are probably from users on older versions of Android.

Error: "Only the Kotlin standard library is allowed to use the 'kotlin' package"

I want to build my first kotlin project in Android studio 3.0.1 . but i got these 2 errors :
Only the Kotlin standard library is allowed to use the 'kotlin' package .
Error:Execution failed for task ':app:compileDebugKotlin'.
how can i use or add the Kotlin standard library?
manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="kotlin.amirreza.mykotlinproject">
<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">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
defaultConfig {
applicationId "kotlin.amirreza.mykotlinproject"
minSdkVersion 16
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
}
You set your package name to kotlin.
Change all package kotlin statements in your .kt files to something like package mykotlintest
It's possible to work around this issue by adding the -Xallow-kotlin-package argument when kotlinc is invoked, that's what Kotlin does to build itself. But changing the package name is a cleaner solution.
As error says :
Only the Kotlin standard library is allowed to use the 'kotlin' package
You can not use 'kotlin' for your package name and your Package (applicationId) is :
kotlin.amirreza.mykotlinproject
So you must change it to something else with renaming or creating new applicaton with another package name
like this
com.amirreza.mykotlinproject
As #EmmanuelBourg correctly mentioned, below there is some code to do this
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions.freeCompilerArgs += ["-Xallow-kotlin-package"]
}

Why does Android Studio throw errors in the manifest file when we change the compileSdkVersion and targetSdkVersion from 26 to 23?

I have searched SO thoroughly and couldn't find the reason for the error that I am facing.
Things I did:
I changed the compileSdkVersion & targetSdkVersions in app gradle file from 26 to 23.
I clicked sync now.
It resulted in 7 error messages making my manifest file go haywire.
Snippets:
My App Gradle file after changing the compile,target sdk versions to 23 from 26
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.airtelanalytics"
minSdkVersion 14
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.+'
compile 'com.jaredrummler:android-processes:1.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Android SDK Platform 23 is installed already
Error Messages (affecting Manifest file) due to change of SDK version from 26 to 23
Manifest file
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="23" />
<application
android:allowBackup="true"
android:debuggable="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="com.analyticsdemo.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
How to fix this ?
I changed the compileSdkVersion & targetSdkVersions in app gradle file from 26 to 23.
That is not a good plan, particularly if you plan to ship via the Play Store, as you will have to raise the values again shortly.
How to fix this ?
The best solution is to move your compileSdkVersion and targetSdkVersion back to 26.
Otherwise, fix the errors reported by the compiler.
In this case, your manifest has android:roundIcon on <application>, and android:roundIcon did not exist back with API Level 23. You are saying, via compileSdkVersion 23, that you want to compile using the rules that existed for API Level 23, and that includes not using things that did not exist back then. So, get rid of android:roundIcon from your actual manifest.

CM Theme not running or not showing up in theme chooser (Settings>Themes)

I am new to creating themes and I'm running CM13, I'm trying to create CM theme. I am just trying to start with a simple theme that changes the wallpaper and lockscreen image. I am using Android Studio. I tried using the template provided by cyanogenmod and I tried to start from scratch. Both would run but would not install properly. I can't seem to get them to show up in the theme chooser under Settings>Theme. I am running nightlies for lg g3 with no other modifications.
My android manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.georgialways.thefluxroom">
<uses-feature android:name="org.cyanogenmod.theme" />
<meta-data android:name="org.cyanogenmod.theme.name" android:value="TheFluxRoom" />
<meta-data android:name="org.cyanogenmod.theme.author" android:value="georgialways" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
</application>
</manifest>
My gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.georgialways.thefluxroom"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
}
My phone Catlog during run
here
Edit:
I found a theme that I can run to my phone and it shows up under themes but I still don't understand why the one from Gabriel will run but the one from Cyanogenmod's github won't run (or at least show up)

Categories

Resources