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

Invalid Configuration, new React Native version #805

Closed
rochapablo opened this issue Jul 19, 2019 · 16 comments
Closed

Invalid Configuration, new React Native version #805

rochapablo opened this issue Jul 19, 2019 · 16 comments

Comments

@rochapablo
Copy link

rochapablo commented Jul 19, 2019

Description:

New React Native version gave me the fallow warning:

warn Package react-native-onesignal has been ignored because it contains invalid configuration. Reason: Unknown option dependency.platforms.ios.sourceDir with value ""./ios"" was found. This is either a typing error or a user mistake. Fixing it will remove this message.

Environment

"react": "16.8.6",
"react-native": "0.60.3",
"react-native-onesignal": "^3.2.14",

Steps to Reproduce Issue:

  1. Install the OneSignal SDK using npm into your project
  2. Build the project
  3. Check for the logs
@blueromans
Copy link

Same issue on 0.60.4

@TolgaCagin
Copy link

@blueromans temporary solution is manual linking, 0.60.4

@blueromans
Copy link

@TolgaCagin Can you describe your way? Because i have try manual linking one more time.

@TolgaCagin
Copy link

TolgaCagin commented Jul 22, 2019

@blueromans , just as usual, dont use react-native link & dont add to react-native-config.js , just manual add required line to settings , app/build.gradle MainApplication.java

@rochapablo
Copy link
Author

@blueromans , just as usual, dont use react-native link & dont add to react-native-config.js , just manual add required line to settings , app/build.gradle MainApplication.java

That doesn't work either.

@yogeshmoradiya121
Copy link

yogeshmoradiya121 commented Jul 22, 2019

not working manual linking also.
please any one have solution?
this is serious issue
help wanted

@rgomezp
Copy link
Contributor

rgomezp commented Jul 22, 2019

Howdy y'all,
We will be releasing the newest version of the react-native SDK with fixes very soon. If you would like to test the changes now, simply change your react-native-onesignal in your package.json to point to this repository.

"react-native-onesignal":"geektimecoil/react-native-onesignal"

Would love to hear your feedback prior to the release. Cheers!

EDIT: PLEASE IGNORE THIS AS THE PLUGIN HAS NOW BEEN PUSHED TO NPM

@yogeshmoradiya121
Copy link

yogeshmoradiya121 commented Jul 23, 2019

after upadting library i faced issue at build time
Could not find androidx.cardview:cardview:28.0.0.
how to solve this??

@rochapablo
Copy link
Author

rochapablo commented Jul 23, 2019

Howdy y'all,
We will be releasing the newest version of the react-native SDK with fixes very soon. If you would like to test the changes now, simply change your react-native-onesignal in your package.json to point to this repository.

"react-native-onesignal":"geektimecoil/react-native-onesignal"

Would love to hear your feedback prior to the release. Cheers!

I'll see and get back to you, just a moment...

[UPDATE]

It didn't work, follow the log

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find androidx.cardview:cardview:28.0.0.
     Required by:
         project :app > project :react-native-onesignal
   > Could not find androidx.cardview:cardview:28.0.0.
     Required by:
         project :app > project :react-native-onesignal > com.onesignal:OneSignal:3.11.1

@thedivac
Copy link

I am having this issue with react-native 0.60.4 and react-native-onesignal 3.3.0:

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RCTOneSignalExtensionService", referenced from: objc-class-ref in NotificationService.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

@simonbuerger
Copy link

I worked around this issue with 0.60 and jetifying for now by doing this in app/build.gradle. Not sure if the new IAM stuff will work, but everything else seems ok.

    implementation (project(':react-native-onesignal')) {
        exclude group: 'com.android.support', module: 'cardview-v7'
    }

    implementation "androidx.cardview:cardview:1.0.0"

@rochapablo
Copy link
Author

rochapablo commented Jul 23, 2019

I worked around this issue with 0.60 and jetifying for now by doing this in app/build.gradle. Not sure if the new IAM stuff will work, but everything else seems ok.

    implementation (project(':react-native-onesignal')) {
        exclude group: 'com.android.support', module: 'cardview-v7'
    }

    implementation "androidx.cardview:cardview:1.0.0"

Thanks! Doing that, I'm able to build ("react-native-onesignal": "^3.3.0").

Well, some observations...

On Android Studio, even having build with success I got some error (which I lost the log) but I had to do the following steps https://stackoverflow.com/a/49645970/1958882.

And, running through react native command react-native run-android, even having build success I also got

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
  - react-native-onesignal (to unlink run: "react-native unlink react-native-onesignal")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.

Now I'm going to see if the push notification it's working...

[UPDATE]

Yep, push notification working!

@rgomezp
Copy link
Contributor

rgomezp commented Jul 23, 2019

Howdy y'all,
Jetifier should be handling this automatically so it must not be working as intended. Please double check that you have followed the AndroidX migration instructions correctly

@rochapablo
Copy link
Author

Howdy y'all,
Jetifier should be handling this automatically so it must not be working as intended. Please double check that you have followed the AndroidX migration instructions correctly

Just to be clear,

I'm not migrating, but I'm starting a new project with the new react-native version, so AndroidX it's already setup.

android.useAndroidX=true
android.enableJetifier=true

Also, I have "postinstall": "npx jetify" always running.

@jkasten2
Copy link
Member

jkasten2 commented Jul 26, 2019

@rochapablo I am not able to reproduce the "could not find androidx.cardview:cardview:28.0.0." error you are seeing. Can you provide a link to an example app and / or exact steps on reproducing it in a new issue?

Closing this issue as the original "warn Package react-native-onesignal has been ignored because it contains invalid configuration" is now fixed in the 3.3.0 version

If you are still see any issues after updating to 3.3.1 please create a new issue

@yogeshmoradiya121
Copy link

yogeshmoradiya121 commented Jul 26, 2019 via email

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

8 participants