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

Conflits with firebase_core:App craches on first open when I add onesignal package to pubspec.yaml #89

Closed
abd3llatif opened this issue May 19, 2019 · 7 comments

Comments

@abd3llatif
Copy link

To reproduce error :
flutter create
add onesignal: ^1.1.0 to pubspec.yaml
add firebase_core: too
flutter run

** Note: data should be cleared -> the error appear in the first open of the apk.

Error: Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:50309/V

@rgomezp
Copy link
Contributor

rgomezp commented May 23, 2019

Could you please provide more info by following our issue template? Thanks

@abd3llatif
Copy link
Author

The version used of OneSignal flutter sdk is ^1.1.0, it s used with firebase_core version 0.4.0+1 last version of firebase core sdk for flutter.

@abd3llatif
Copy link
Author

Gradle App module :

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.testonesignal"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'


}

apply plugin: 'com.google.gms.google-services'

Gradle Project level:

buildscript {
    repositories {
        google()
        jcenter()

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath 'com.google.gms:google-services:4.2.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Pubspec.yaml

name: testonesignal
description: A new Flutter project.

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  onesignal: ^1.1.0
  firebase_core:

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:

  uses-material-design: true

@rgomezp
Copy link
Contributor

rgomezp commented May 28, 2019

@AbdoXLabs I don't see how the OneSignal plugin is causing this issue. The error
Error: Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:50309/V doesn't mention anything with OneSignal

@abd3llatif
Copy link
Author

Yeah sure, the log is not clear ! just try to reproduce the error by creating a flutter project and add onesignal: ^1.1.0 and firebase_core: to your pubspec.yaml.
then run the app on android.

@rgomezp
Copy link
Contributor

rgomezp commented Jun 25, 2019

Thank you for your patience. We will be releasing an update soon that we hope fixes several issues. In the meantime, can you try following this?

@rgomezp
Copy link
Contributor

rgomezp commented Aug 15, 2019

This has since been fixed @AbdoXLabs

@rgomezp rgomezp closed this as completed Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants