-
Notifications
You must be signed in to change notification settings - Fork 370
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
Gradle if minifyAble set to true One Signal detects Support Library isn't added. #533
Comments
Have the same issue with 3.9.0 only in release builds proguard-rules.pro is added from |
@mvvOrigin it good to read I'm not alone with my problem. I tried to downgrade back to previous version, but is didn't solve this issue. |
I have another project where I use One Signal. Before I was able to build a signed minified apk. Now I tried to build a debug apk without minify, and One Signal worked properly. But if I set minifyEnabled true, I get the same issue. One Signal throws an error, Android Support Library cannot been found. |
@mvvOrigin Today morning I found a workaround. I had to set multidexEnabled to true, than I was able to set minifyEnabled to false. Without multidex I can't turn of minify, because of 65k methods limit. If I build my apk with these settings, One Signal works. |
I have the same issue with enabled proguard. I take the proguard rules from the documentation and |
I've encountered the same problem on release build with minify enabled.
|
@yokrysty wow, thanks bro. it works |
@yokrysty Thanks for digging in and providing a solution. It seems proguard started renaming public class names recently. I have updated |
Hello I have got an email
*#533 (comment)
<#533 (comment)>*
will test it today
*
<#533 (comment)>*debug
build is working fine for me
2018-05-14 10:37 GMT+03:00 Molnár Dániel <notifications@github.com>:
… @mvvOrigin <https://github.com/mvvOrigin> Today morning I found a
workaround. I had to set multidexEnabled to true, than I was able to set
minifyEnabled to false. Without multidex I can't turn of minify, because of
65k methods limit. If I build my apk with these settings, One Signal works.
But I'm still waiting for a solution, because I want to minify and
obfuscate my app.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#533 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALKZb-eZtUEWpp5j9GzEQbDr8PGwb67pks5tyTRDgaJpZM4T7epS>
.
|
----update----
Today morning I tried to set multidexEnabled to true, than I was able to set minifyEnabled to false. Without multidexing I'm not able to set miniyEnabled to false because of 65k methods limit. With these settings One Signal works perfectly.
But if turn minifyAble to false, I get an error message, Support Library is not added to project. (Anyway which support lib is missing for OS?) But I've to add
-keep class com.google.firebase.** to prevent error reported below.
I added
-keep class com.android.support.**
-keep interface com.android.support.**
to my proguard, but it isn't solved missing support lib.
--------------
Even if I add One Signal Plugin or not, or even if I add Support Library or not, I get this error, but just if I build an APK by Build->Build APK(s) or Build->Generate Signed APK, than install and start it on device.
If I just start my app by Adnroid Studio->Run 'app', it works well, I get FCM token and my app can receive push notifications.
This is my app level build.gradle
buildscript {
ext.firebase_version = '12.0.1'
ext.support_version = '27.1.1'
repositories {
mavenCentral()
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com' }
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.9.0'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.objectbox'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
apply plugin: 'com.jakewharton.hugo'
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
}
android {
signingConfigs {
release {
****
}
}
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
targetSdkVersion 27
manifestPlaceholders = [
onesignal_app_id : '******',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE']
}
testOptions {
unitTests.returnDefaultValues = true
}
flavorDimensions "default"
productFlavors {
def BOOLEAN = "boolean"
def TRUE = "true"
def FALSE = "false"
def INDEX = "index"
def CSH = "csh"
csh {
dimension "default"
versionCode 5
versionName '1.0.5'
minSdkVersion 15
applicationId "hu.cemp.csh"
buildConfigField BOOLEAN, INDEX, FALSE
buildConfigField BOOLEAN, CSH, TRUE
}
index {
dimension "default"
minSdkVersion 15
versionCode 14584
versionName '5.0.45'
applicationId "com.aff.index.main"
buildConfigField BOOLEAN, INDEX, TRUE
buildConfigField BOOLEAN, CSH, FALSE
}
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
buildTypes {
def BOOLEAN = "boolean"
def TRUE = "true"
def FALSE = "false"
def HAS_DEBUG_MENU = "HAS_DEBUG_MENU"
def REPORT_CRASHES = "REPORT_CRASHES"
canary {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationIdSuffix ".canary"
versionNameSuffix '-canary'
buildConfigField BOOLEAN, HAS_DEBUG_MENU, TRUE
debuggable true
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationIdSuffix ".debug"
versionNameSuffix '-debug'
buildConfigField BOOLEAN, HAS_DEBUG_MENU, TRUE
debuggable true
}
preview {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationIdSuffix '.preview'
versionNameSuffix '-preview'
buildConfigField BOOLEAN, HAS_DEBUG_MENU, TRUE
debuggable true
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField BOOLEAN, REPORT_CRASHES, TRUE
buildConfigField BOOLEAN, HAS_DEBUG_MENU, FALSE
signingConfig signingConfigs.release
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
kapt {
generateStubs = true
arguments {
arg("objectbox.daoCompat", true)
}
}
}
sourceSets {
csh { assets.srcDirs = ['src/csh/assets', 'src/csh/assets/'] }
main { res.srcDirs = ['src/main/res', 'src/test/resources'] }
}
}
dependencies {
/Kotlin/
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
The text was updated successfully, but these errors were encountered: