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

Android: Incorrect RNIapPackage import with react-native link #49

Closed
henkkasoft opened this issue Mar 1, 2018 · 4 comments
Closed

Android: Incorrect RNIapPackage import with react-native link #49

henkkasoft opened this issue Mar 1, 2018 · 4 comments

Comments

@henkkasoft
Copy link

Version of react-native-iap

0.2.15
react-native: 0.53.3

Expected behavior

react-native link react-native-iap should update MainApplication.java and android/app/build.gradle correctly

Actual behavior

link adds MainApplication.java
import com.dooboolab.RNIap.RNIapPackage;
it should be: com.reactlibrary.RNIapPackage

Also:
compile project(':react-native-iap') is not updated to android/app/build.gradle, it have to be done by hand.

Thank you very much for the component, not yet fully in use but seems very useful.

@hyochan
Copy link
Owner

hyochan commented Mar 2, 2018

@henkkasoft
I've just tried react-native link react-native-iap with clean project from react-native init and worked fine.

➜  LinkTest npm install      
➜  LinkTest react-native link react-native-iap
Scanning folders for symlinks in /Users/hyochan/Documents/SourceCode/TestProjects/LinkTest/node_modules (27ms)
rnpm-install info Linking react-native-iap android dependency 
rnpm-install info Android module react-native-iap has been successfully linked 
rnpm-install info Linking react-native-iap ios dependency 
rnpm-install info iOS module react-native-iap has been successfully linked 

I've checked into android project and everything linked properly. Also compile project has been done successfully without manually installing it.

include ':react-native-iap'
project(':react-native-iap').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-iap/android')

I've heard react-native link system is not that perfect so we've written manual installation guide. However, I guess more than 90%, it would be fine. Did you also try with clean install from react-native project?

@brentjanderson
Copy link

I have seen the same issue on the project I'm working on, FWIW. Linking uses import com.dooboolab.RNIap.RNIapPackage; instead of com.reactlibrary.RNIapPackage;. I have had to use the manual linking steps accordingly.
(refs #46)

@hyochan
Copy link
Owner

hyochan commented Mar 2, 2018

@henkkasoft @brentjanderson
Thank you for the bug report. I've just updated npm to 0.2.16 with breaking changes readme. Now the package name will be fixed to com.dooboolab.RNIap.RNIapPackage. This will be updated when you install npm install --save react-native-iap@0.2.16 and just open up the android studio with android dir of your react-native project. Then it will warn you with no module found for react-native-iap so remove it. Then it will automatically find your module and link it for you if it was already installed.

Thank you. Tell me if there is another problem after 0.2.16 with the package name.

@hyochan hyochan closed this as completed Mar 5, 2018
@henkkasoft
Copy link
Author

Just another comment on instructions.

iOS manual instructions step 2 is missing "ios" folder:
Go to node_modules ➜ react-native-iap and add RNIap.xcodeproj
should be:
Go to node_modules ➜ react-native-iap ➜ ios and add RNIap.xcodeproj

Didn't want to create a new issue for so obvious small thing.

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

3 participants