Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Mode Build 😞 💥 #24

Open
onuryurtturk opened this issue Sep 8, 2017 · 3 comments
Open

Release Mode Build 😞 💥 #24

onuryurtturk opened this issue Sep 8, 2017 · 3 comments

Comments

@onuryurtturk
Copy link

onuryurtturk commented Sep 8, 2017

How to build project for signed apk?. When I generate signed apk. It doesnt install on device. Im thinking about this is occurring because the library didn't build for release. How can i build for release mode?

@onuryurtturk onuryurtturk changed the title Release Mode Build 😞 Release Mode Build 😞 💥 Sep 8, 2017
@Beyka
Copy link
Owner

Beyka commented Sep 8, 2017

Library has only debug build version, but it works in release build types. Maybe you forgot add rules to proguard?

-keep class org.beyka.tiffbitmapfactory.**{ *; }

If with proguard all ok, please provide you build.gradle file(build and flavour type sectoin)

@onuryurtturk
Copy link
Author

I dont use proguard but added that line. Not working. Release apk not install on device. Any solution?

` apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
    applicationId "xyz"
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    multiDexEnabled true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

/* splits {

    // Configures multiple APKs based on ABI.
    abi {

        // Enables building multiple APKs per ABI.
        enable true

        // By default all ABIs are included, so use reset() and include to specify that we only
        // want APKs for x86, armeabi-v7a, and mips.

        // Resets the list of ABIs that Gradle should create APKs for to none.
        reset()

        // Specifies a list of ABIs that Gradle should create APKs for.
        include "x86", "armeabi-v7a", "mips" , 'armeabi'

        // Specifies that we do not want to also generate a universal APK that includes all ABIs.
        universalApk false
    }
}*/

}

// Map for the version code that gives each ABI a value.
ext.abiCodes = ['armeabi':1, 'armeabi-v7a':2, mips:3, x86:4]

// For per-density APKs, create a similar map like this:
// ext.densityCodes = ['mdpi': 1, 'hdpi': 2, 'xhdpi': 3]

import com.android.build.OutputFile

// For each APK output variant, override versionCode with a combination of
// ext.abiCodes * 1000 + variant.versionCode. In this example, variant.versionCode
// is equal to defaultConfig.versionCode. If you configure product flavors that
// define their own versionCode, variant.versionCode uses that value instead.
android.applicationVariants.all { variant ->

// Assigns a different version code for each output APK
// other than the universal APK.
variant.outputs.each { output ->

    // Stores the value of ext.abiCodes that is associated with the ABI for this variant.
    def baseAbiVersionCode =
            // Determines the ABI for this variant and returns the mapped value.
            project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))

    // Because abiCodes.get() returns null for ABIs that are not mapped by ext.abiCodes,
    // the following code does not override the version code for universal APKs.
    // However, because we want universal APKs to have the lowest version code,
    // this outcome is desirable.
    if (baseAbiVersionCode != null) {

        // Assigns the new version code to versionCodeOverride, which changes the version code
        // for only the output APK, not for the variant itself. Skipping this step simply
        // causes Gradle to use the value of variant.versionCode for the APK.
        output.versionCodeOverride =
                baseAbiVersionCode * 1000 + variant.versionCode
    }
}

}

repositories {
maven { url "https://jitpack.io" }
}
`

@Beyka
Copy link
Owner

Beyka commented Sep 10, 2017

Only option that I never try with lib is multiDexEnabled. Could you try to remove that option and test build?
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants