shehankonecranes / sp-react-native-mqtt

MQTT Client native module for react-native
68 stars 55 forks source link

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

Open KacperPaszkowski opened 3 years ago

KacperPaszkowski commented 3 years ago

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 commented 3 years ago

same problem...

hongweiCui commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

luatvudinh commented 2 years ago

Wish this will help someone.

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

ds94059 commented 2 years ago

Wish this will help someone.

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

thx, it works