react-native-braintree-dropin-ui
react-native-braintree-dropin-ui copied to clipboard
error: cannot find symbol RNBraintreeDropInPackage
Please provide any solution of this issue:-
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: F:\react-native\baintree\ioscode\node_modules\react-native-braintree-dropin-ui\android\src\main\java\tech\power\RNBraintreeDropIn\RNBraintreeDropInModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
F:\react-native\baintree\ioscode\android\app\build\generated\rncli\src\main\java\com\facebook\react\PackageList.java:19: error: cannot find symbol
import tech.bam.RNBraintreeDropIn.RNBraintreeDropInPackage;
^
symbol: class RNBraintreeDropInPackage
location: package tech.bam.RNBraintreeDropIn
F:\react-native\baintree\ioscode\android\app\build\generated\rncli\src\main\java\com\facebook\react\PackageList.java:58: error: cannot find symbol
new RNBraintreeDropInPackage(),
^
symbol: class RNBraintreeDropInPackage
location: class PackageList
2 errors
Environment: "react": "16.8.6", "react-native": "^0.60.5", "react-native-braintree-dropin-ui": "^1.0.3",
Hey @tbiinfotech were you ever able to figure this out?
I had the same problem- it's because of tech.bam being replaced by tech.power. Put this in your react-native.config.js to disable autolinking: module.exports = { dependencies: { 'react-native-braintree-dropin-ui': { platforms: { android: null, // disable Android platform, other platforms will still autolink if provided }, }, }, };
Then follow the instructions and you should be OK
@shaunakk Does that not mean the package will not be available for Android?
No u just have to manually link...
I had the same issue, just changed from import tech.bam.RNBraintreeDropIn.RNBraintreeDropInPackage; to import tech.power.RNBraintreeDropIn.RNBraintreeDropInPackage;
@akhlopyk in which file do we need to change this.
@pramodkumar005 in MainApplication.java
@pramodkumar005 the import is actually in the PackageList.java @akhlopyk this is still not working.
Got a solution ( It's just a workaround not recommended ) In node modules > react-native-braintree-dropin-ui > android > src > main > AndroidManifest.xml change package="tech.bam.RNBraintreeDropIn" to package="tech.power.RNBraintreeDropIn"
This solved my problem for now. Thanks
@pramodkumar005
I was able to get this working by adding react-native.config.js into my projects root directory and adding
module.exports = { dependencies: { 'react-native-braintree-dropin-ui': { platforms: { android: null, // disable Android platform, other platforms will still autolink if provided }, }, }, };
to the file, then I ensured to unlink the library from my application. When running the project again it will remove the reference from PackageList.java and add it to the MainApplicaton.java as an import, change the import tech.bam.RNBraintreeDropIn.RNBraintreeDropInPackage; to import tech.power.RNBraintreeDropIn.RNBraintreeDropInPackage;
as @akhlopyk and it works.
In the manual linking steps the import is correct using import tech.power.RNBraintreeDropIn.RNBraintreeDropInPackage; However the automatic linking uses tech.bam.
Is it possible to fix this for the package? That'd be nice for new users. I would do this myself and send you guys a PR but I still have little knowledge on react native and linking.