Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Francesco Di Vito
Francesco Di Vito
4,502 Points

Android apk release crash foe sql lite query

Hi at all, i have build a signed apk relese mode for my app using the way describe into android course and this is my build.grandle: ''' buildscript { repositories { maven { url 'https://maven.fabric.io/public' } }

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
}

} apply plugin: 'com.android.application' apply plugin: 'io.fabric'

repositories { maven { url 'https://maven.fabric.io/public' } }

android { compileSdkVersion 22 buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "it.ingv.android"
    minSdkVersion 16
    targetSdkVersion 21
    versionCode 0
    versionName "5"
}

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

}

dependencies { compile 'com.google.android.gms:play-services:3.2.25' compile files('libs/commons-io-2.4.jar') compile files('libs/gson-2.2.4.jar') compile files('libs/nineoldandroids-library-2.4.0.jar') compile 'com.github.nirhart:parallaxscroll:1.0' compile 'com.android.support:appcompat-v7:21.0.3' compile files('libs/Volley.jar') compile project(':PullToRefreshmaster') compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') { transitive = true; } compile files('libs/picasso-2.5.2.jar') compile 'com.nispok:snackbar:2.11.0' compile 'com.williammora:snackbar:1.4.0' compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.1@aar') { transitive = true; } compile 'me.drakeet.materialdialog:library:1.2.2'

}

crashlytics { enableNdk true androidNdkOut 'src/main/obj' androidNdkLibsOut 'src/main/libs' }

'''

now when i have istalled apk and run app my app crash when i run a function for query on sqlite db, but if i run app on genymotion emulator there isn't a crash.

i have set this in proguard-rules:

-assumenosideeffects class android.util.Log { public static boolean isLoggable(java.lang.String, int); public static int v(...); public static int i(...); public static int w(...); public static int d(...); public static int e(...); }

-dontwarn com.squareup.okhttp.* -keep class com.db.models.** -keepclassmembers class com.db.models.** { ; } -keep class android.app.Activity -keep class android.app.* -keep class org.sqlite.** { ; } -keep class org.sqlite.database.* { *; }

Any help please? Thanks