The application I uploaded on the Play Store kept getting stuck on some models, so I sent an error...
java.lang.OutOfMemoryError
Is there a solution to this?
Someone told me to check the Minimum SDK.
When I entered the build.gradle,
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "org.androidtown.minirobot"
minSdkVersion 15
targetSdkVersion 24
versionCode 2
versionName "1.0.2"
}
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:24.0.0'
}
I don't think it's a version issue because it's like this.
I thought the first application was over, but it's frustrating ㅠ<
android
Out of memory is an error that occurs when the available memory limit is exceeded. Therefore, I think it would be appropriate to say that it is not directly related to the minSdkVersion version.
First of all, the simplest way to apply it is to have more memory available to the app. Please set the largeHeap option to true in AndroidManifest.xml and test it as follows.
<application
android:largeHeap="true">
</application>
If out of memory still occurs, please debug whether any of the code you wrote uses more memory than you intended or causes memory leaks. Please refer to the link below for this matter.
If you find it difficult to detect problems on your own, one of the ways to use the LeakCanary library is to find out which part of the code is causing memory leaks.
© 2024 OneMinuteCode. All rights reserved.