react-native-braintree-dropin-ui icon indicating copy to clipboard operation
react-native-braintree-dropin-ui copied to clipboard

error: cannot find symbol RNBraintreeDropInPackage

Open tbiinfotech opened this issue 5 years ago • 11 comments

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 Screenshot_2

Environment: "react": "16.8.6", "react-native": "^0.60.5", "react-native-braintree-dropin-ui": "^1.0.3",

tbiinfotech avatar Sep 18 '19 11:09 tbiinfotech

Hey @tbiinfotech were you ever able to figure this out?

pouyaemami avatar Oct 09 '19 21:10 pouyaemami

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 avatar Oct 13 '19 07:10 shaunakk

@shaunakk Does that not mean the package will not be available for Android?

pouyaemami avatar Oct 15 '19 17:10 pouyaemami

No u just have to manually link...

shaunakk avatar Oct 15 '19 17:10 shaunakk

I had the same issue, just changed from import tech.bam.RNBraintreeDropIn.RNBraintreeDropInPackage; to import tech.power.RNBraintreeDropIn.RNBraintreeDropInPackage;

akhlopyk avatar Nov 01 '19 13:11 akhlopyk

@akhlopyk in which file do we need to change this.

pramodkumar005 avatar Nov 04 '19 06:11 pramodkumar005

@pramodkumar005 in MainApplication.java

akhlopyk avatar Nov 04 '19 07:11 akhlopyk

@pramodkumar005 the import is actually in the PackageList.java @akhlopyk this is still not working.

Rakeda avatar Nov 04 '19 12:11 Rakeda

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 avatar Nov 04 '19 12:11 pramodkumar005

@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.

Rakeda avatar Nov 04 '19 12:11 Rakeda

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.

uhmarcel avatar Nov 16 '19 06:11 uhmarcel