0

I'm trying to generate APK to install my app (e.g. Google Play). APK works FINE in Android 10.0 but I have an error when trying to install on ANDROID 6.0 [Error when trying to install in Android 6.0][1] [1]: https://i.stack.imgur.com/C20RJ.jpg

I have already tried:

  1. change in gradle minSdkVersion to lower
  2. both phones have developers permissions
  3. access to install apps from unknown sources.

But that won't work.

What interesting I can run project via Android Studio even in debug mode in Android 6.0. And that work perfectly.

Also I use Git. So I switched to older versions (which worked!) and still have same problem. (I guess problem is out of code)

That is my build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "29.0.2"

    defaultConfig {
        applicationId "com.malinowski.jump"
        minSdkVersion 23
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

allprojects {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
    }
}

dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.9'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.preference:preference:1.1.0-alpha05'
    implementation files('libs\\java-android-websocket-client-1.2.2.jar')
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

2 Answers2

2

A possible problem lies with your android manifest xml file.

If you do not have android:exported="true" , it may lead to 'There was a problem parsing the package'.

Explanation: The presence of at least one filter implies that the broadcast receiver is intended to receive intents broadcast by the system or other applications, so the default value is "true".

Therefore, your manifest should have android:exported="true"

See below:

<activity
  android:name=".MainActivity"
  android:exported="true"
  android:screenOrientation="portrait">
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>
</activity>
Kevin
  • 109
  • 6
1

Actually I found solution. In my case all that I needed was just generate APK for both V1 and V2 versions.