My app crashes on devices running Android version below 9 - android

I am testing my app in Samsung remote lab and discovering that it keep crashing in devices running on Android below 9.
Searching on Google made me only more confused and aware of how vast is my ignorance.
build.cradle:
android {
compileSdkVersion 28
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.photobangkok.moneytalk"
minSdkVersion 16
targetSdkVersion 28
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.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.android.gms:play-services-ads:20.1.0'
}
When I try to lower minSDKversion to 14 I got the below error:
Manifest merger failed : uses-sdk:minSdkVersion 14...
I am showing ads in this app so I need to use adroidx.

Related

Android project: gradle configure fails

I am trying to create a new project but the build fails and I can't solve it, can anyone tell me what was wrong in below picture
apply plugin: 'com.android.application' android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.hossein.myshgop"
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-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
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'}
It seems there is an issue with the internet connection in your PC. Please check internet connection. Gradle requires proper internet connection.

The device might have stale dexed jars that don't match the current version (dexopt error)

I m facing this problem when trying to simulate program on Nexus 7 API 21. Working fine on other mobile emulator.
10/28 14:38:22: Launching 'app' on Nexus 7 (2012) API 21.
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_DEXOPT
The device might have stale dexed jars that don't match the current version (dexopt error).
My build gradle is :
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "test.taha.interactiveguitesting"
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 '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'
}
Add in gradle.properties
android.enableD8=false
android.enableD8.desugaring=false

What's the right material design library to use in my gradle, i've tried different solutions, it's not building successfully

I'm trying to test the FAB concept in my app but it's not working following the guidelines i got maybe because i didn't understand it well, see my gradle file below:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "study.timmy.micah.materialdesignpractices"
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-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:28.0.0-alpha1'
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'
}

com.android.builder.dexing.DexArchiveBuilderException

The android application has a dependency: com.googlecode.objectify
The following error is thrown while building the project:
com.android.builder.dexing.DexArchiveBuilderException: Failed to process /home/homecomp/.gradle/caches/modules-2/files-2.1/com.googlecode.objectify/objectify/5.1.16/148ca59a5f89b394eb998ce1894d222c7e11131d/objectify-5.1.16.jar
Here is the complete build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.homecomp.myapplication"
minSdkVersion 21
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-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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'
implementation 'com.googlecode.objectify:objectify:5.1.16'
}
error screenshot
I would be very surprised if the Google App Engine SDK (which Objectify depends on) works on Android. If it did, it would certainly require the Remote API.
You might try Objectify6, which uses a newer Google SDK and REST-based API and is more likely to work on Android. You should check.
That said... directly accessing your datastore from a mobile app? Sounds like a terrible idea.

How to select other api level in Android studio?

I am following this tutorial.
I got a Render problem. By searching from web, I found that the api level should be changed to a lower version, link.
The problem is that I cannot select a lower api version:
How to solve it?
You can set the API level on your app build.gradle file. Open it on ProjectFolder/app/build.gradle.
You can work with a stable Android API (like 27) since Android P API (API level 28) is on Developer Preview stage.
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.app"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.myfirstapp"
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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'
}
Finally, this is my build.gradle.

Categories

Resources