Apk doesn't work after changing compileSdkVersion to android-P - android

It's really strange, I created a new empty project and then I changed in file settings compileSdkVersion from 27.1 Oreo to android-P, then I refactored app to AndroidX and it's working fine if I run it on emulator or via adb connect with my device. But when I try to build apk and install it on my phone here's problem appear - 'App not installed'. But before I changed compileSdkVersion apk installs fine.
Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ru.scapegoats.myapplicationmmmm">
<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=".main"
android:label="#string/app_name">
<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 'android-P'
defaultConfig {
applicationId "ru.scapegoats.myapplication"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0-alpha3'
implementation 'com.google.android.material:material:1.0.0-alpha3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3'
}

You cannot install app with compileSdkVersion 'android-P' preview version on older OS.
Since beta release for Android P is out, change compileSdkVersion to 28:
compileSdkVersion 28
Note: Ensure you have internet connection so that proper SDK updates can be downloaded.

Related

Hello World Android project is not installing in REDMi Note 5

I have prepared a new android development setup in my windows 7 64-Bit machine.
Android Studio Version: 3.5.3
JDK: 1.8.0_231
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 21
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 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
AndroidManufest.java
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.example.myapplication">
<dist:module dist:instant="true" />
<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>
When I install the APK file generated after compilation in emulator (Nexus 6P API 27 x86) it works fine. However, when I am trying to install the same APK file in my phone its not installing. I have already deactivated Play Protect options.
disable wifi and mobile data and get build then install apk on your phone
i seen this issue in my app and It looks like google protect stuff
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
Solved my problem.

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.firebase:firebase-iid:19.0.0]

On including implementation 'com.google.firebase:firebase-core:17.0.0'
in my build.gradle(app) my project does not successfully sync.
i've tried cleaning up the project i've tried ,as the error suggests, increasing minSdkVersion to 16 (it gives another error) but nothing worked.
build.gradle(app)
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.saad.error"
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'
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
}
apply plugin: 'com.google.gms.google-services'
Manifest file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.saad.error">
<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>
I just started developing on Android and got that same error. I changed my minSdkVersion from 15 to 16, and then it built and ran.
I'm not an expert but I had the same problem just now and I went to the app folder in android mode right-clicked it and entered 'open module settings'.In the 'default config' I set the minSDK to the versions I have installed
Got the same problem just fix it by migrating the project to androidx
Click on the Refactor tab->Migrate to androidx->Just give a backup directory->click again Refactor
Hope this will clear the same

My Android mobile app Installation failed on Android version4.4.4

My Android mobile app is successfully installing only on android version 6.0.1 but I want to install it on android version 4.4.4. What changes I have to do?
Here in my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.pervaizahmed.ilmileaveapplication">
<uses-sdk android:maxSdkVersion="27" />
<uses-permission android:name="android.permission.SEND_SMS" />
<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/Theme.AppCompat">
<activity android:name=".welcomeScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" />
</application>
</manifest>
Here is Gradle Code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.pervaizahmed.ilmileaveapplication"
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'
}
}
productFlavors {
}
buildToolsVersion '26.0.2'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:design:26.0.2'
implementation 'com.android.support:support-v4:26.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Problem solved just by removing this line.
androidTestImplementation 'com.android.support.

Manifest merger failed with multiple errors, see logs and cannot build a project

I'm working with Android Studio.
But when I want to run my project return error:
Error:Execution failed for task ':audiorecordlibrary:processReleaseManifest'.> Manifest merger failed with multiple errors, see logs
My app gradle and manifest :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.cleveroad.audiovisualization.example"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
final SUPPORT_LIB_VERSION = '23.0.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
compile project(':audiorecordlibrary')
compile project(':library')
compile files('libs/junit-4.12.jar')
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.cleveroad.example">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/av_app_name"
android:supportsRtl="true"
tools:replace="android:supportsRtl"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
</application>
</manifest>
my audiorecordlibrary gradle and manifest is :
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 22
versionCode 2
versionName "1.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
//testCompile 'org.robolectric:robolectric:2.4'
testCompile 'org.mockito:mockito-all:1.8.4'
}
apply from: '../maven_push.gradle'
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="republicofgavin.pauseresumeaudiorecorder">
<application
tools:replace="android:icon" android:allowBackup="true" android:label="#string/app_name">
</application>
</manifest>
and my another library gradle and manifest is :
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
resourcePrefix "av_"
}
dependencies {
final SUPPORT_LIB_VERSION = '23.0.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleDependency
compile "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
}
apply from: './gradle-mvn-push.gradle'
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="com.cleveroad.audiovisualization"/>
My project was implemented before I add audiorecordlibrary to my project.
Can anybody help me ??

Set google play services in Android Studio?

I am following these two links to set up the play services
Setting Up Google Play Services
Accessing Google APIs
But it is unable to find google api client class
THis is my gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.wishygupta.myapplication"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
}
This is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.wishygupta.myapplication" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
What am I doing wrong?
As it is recommended by Google also, try to use + sign for subversion of support library and google play service as following:
compile 'com.android.support:appcompat-v7:21.+'
compile 'com.google.android.gms:play-services:6.5.+'
Also ensure you have downloaded the latest Play Services SDK version 22 under Extras is installed.
Sample dependency section in my grade file.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.+'
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.google.android.gms:play-services:6.5.+'
}

Categories

Resources