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

Could not find :sp-react-native-mqtt: #14

Open
KacperPaszkowski opened this issue Feb 11, 2021 · 7 comments
Open

Could not find :sp-react-native-mqtt: #14

KacperPaszkowski opened this issue Feb 11, 2021 · 7 comments

Comments

@KacperPaszkowski
Copy link

KacperPaszkowski commented Feb 11, 2021

I'm trying to build app with this library. I changed all files shown in README and I'm still getting error

> Configure project :react-native-mqtt
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find :sp-react-native-mqtt:.
     Required by:
         project :app

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s
@hongweiCui
Copy link

same problem...

@hongweiCui
Copy link

build.gradle

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':sp-react-native-mqtt')
}

not

implementation ':sp-react-native-mqtt'

@hongweiCui
Copy link

THEN
DO NOT ADD packages.add(new RCTMqttPackage()); IN MainApplication.java

LIKE
@OverRide
protected List getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
// packages.add(new RCTMqttPackage());
return packages;
}

@rogeriocassares
Copy link

rogeriocassares commented Apr 6, 2021

Hi! Have you ever tried just run yarn add sp-react-native-mqtt?

This worked for me with no adding modifying. I have just checked in android/app/src/main/AndroidManifest.xml if <uses-permission android:name="android.permission.INTERNET" /> was there and thats it!

@esbenvb
Copy link

esbenvb commented Oct 13, 2021

What worked for me, with RN 0.65.1 was to not change any of the Android project files and just install the module using yarn and build again. The only manual change I made was the Podfile on iOS.

@luatvudinh
Copy link

Wish this will help someone.

https://stackoverflow.com/a/56876517/6318077

@ds94059
Copy link

ds94059 commented Jun 7, 2022

Wish this will help someone.

https://stackoverflow.com/a/56876517/6318077

thx, it works

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

6 participants