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

[Android] No variants found for 'notifee_react-native'. #246

Closed
Yann-prak opened this issue Nov 24, 2021 · 7 comments
Closed

[Android] No variants found for 'notifee_react-native'. #246

Yann-prak opened this issue Nov 24, 2021 · 7 comments

Comments

@Yann-prak
Copy link

Hi,

Am I the only one having problems during installation ? I've followed the steps needed and I can't have Notifee working on Android.

On Gradle sync, I get this error :
Check build files to ensure at least one variant exists.

If I ignore it and try to run project, it obviously won't and it gives me this one :
error: package io.invertase.notifee does not exist import io.invertase.notifee.NotifeePackage;

Does anyone run into this one ?

@mikehardy
Copy link
Collaborator

Sorry, no.
Have you tried the example?
Or: https://github.com/mikehardy/rnfbdemo/blob/master/notifee-demo.sh
That shows a built-from-scratch minimal reproducible react-native with notifee in it.
Somewhere in the difference between that project and your integration is the problem.
With apologies, this will not result in a change in the module and that's what we use the issues list for so I'm going to close this, but if you read the script (you don't even have to execute it) you'll see how to do the integration. And if you run it you should have a Notifee app working so that should help

@Yann-prak
Copy link
Author

Thanks, I already used it (read & run) and didn't find any differences. I'll try again.

Read all the issues list and issues on github but I didn't find anything similar to my problem.

@mikehardy
Copy link
Collaborator

@Yann-prak
Copy link
Author

Yann-prak commented Nov 24, 2021

Already check these two links 😅
It didn't work. I have all SDK needed (from 28 to 31).

When I run your script, I can find notifee_react-native without problem
Notifee

But in my project it does not appear, might be the root of the problem but I do not find why this is happening.
App

In my app build.gradle, since I added notifee, this import is not working anymore :
import com.android.build.OutputFile

Just to be clear, this is my project build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext {
        // 29.0.2
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:4.2.2')
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        mavenCentral()
        mavenLocal()
        maven { url "$rootDir/../node_modules/@notifee/react-native/android/libs" }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        google()
        maven { url 'https://www.jitpack.io' }}
}

@Yann-prak
Copy link
Author

Yann-prak commented Nov 25, 2021

Ok, finally found the solution. It was link to onesignal. Not the same error but same problem came from their library. Leaving this for anyone with the same problem. Just follow #124 or documentation.

@Yann-prak
Copy link
Author

@mikehardy just to be sure, when you were testing incompatibilities with onesignal, did removing the onesignal gradle plugin from you build.gradle make onesignal stop working in RN ? Somehow, I can't have both libs working together...

@mikehardy
Copy link
Collaborator

Not using their plugin is specifically mentioned: https://notifee.app/react-native/docs/integrations/onesignal
I never tested it personally, I have never used OneSignal, we gave credit in the docs to the folks that contributed the information

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