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

Autolinking support RN 60+ #28

Open
sayler8182 opened this issue Nov 21, 2019 · 8 comments
Open

Autolinking support RN 60+ #28

sayler8182 opened this issue Nov 21, 2019 · 8 comments

Comments

@sayler8182
Copy link

No description provided.

@likern
Copy link

likern commented Jan 22, 2020

It looks like autolinking is working out of the box.
I've updated settings as is said in README, excluding updating MainActivity.java (haven't add package manually) and it works just fine.

Otherwise, when I tried to add package manually - I've got error saying that package is registered twice.

@DnEgorWeb
Copy link

README is really outdated, I opened a PR a year and a half ago to fix a line (but no response), now it should be also corrected for RN 60+. Not so obvious for those who use the package for the very first time.

@storatus
Copy link

Is this working fine ? I have implemented it in RN 61.5 leaving out the MainActivity.java step, and it seems to be working. Anyone else had some experience ?

@ssilverberry
Copy link

ssilverberry commented Feb 26, 2021

@storatus Yeah, me too, actually I've tried both options, with all these pointed steps in README (but also skipped MainActivity.java step) also just installed the library without adding anything else in android folders/configs, it seems to be working I mean it changes keyboard adjustment and there are no errors while building an app.

@czy0729
Copy link

czy0729 commented Mar 12, 2021

@storatus Yeah, me too, actually I've tried both options, with all these pointed steps in README (but also skipped MainActivity.java step) also just installed the library without adding anything else in android folders/configs, it seems to be working I mean it changes keyboard adjustment and there are no errors while building an app.

0.63 working fine too

just few steps:

  1. npm install --save [email protected]

  2. copy AndroidKeyboardAdjust/*.java to /android/app/src/main/java/com/your_name/project_name/AndroidKeyboardAdjust

  3. edit /android/app/src/main/java/com/your_name/project_name/MainApplication.java

+ import com.your_name.project_name.AndroidKeyboardAdjust.AndroidKeyboardAdjustPackage;

...

@Override
    protected List<ReactPackage> getPackages() {
      List<ReactPackage> packages = new PackageList(this).getPackages();
      ...
+     packages.add(new AndroidKeyboardAdjustPackage());
      ...
      return packages;
    }

that's all

now you can use in your project

const AndroidKeyboardAdjust = require('react-native-android-keyboard-adjust')

@karthikNAS
Copy link

copy AndroidKeyboardAdjust/*.java to /android/app/src/main/java/com/your_name/project_name/AndroidKeyboardAdjust

copy from where?

@czy0729
Copy link

czy0729 commented Jun 21, 2022

copy AndroidKeyboardAdjust/*.java to /android/app/src/main/java/com/your_name/project_name/AndroidKeyboardAdjust

copy from where?

https://github.com/zubricky/react-native-android-keyboard-adjust/tree/master/android/src/main/java/net/zubricky/AndroidKeyboardAdjust

@karthikNAS
Copy link

karthikNAS commented Jun 21, 2022

copy AndroidKeyboardAdjust/*.java to /android/app/src/main/java/com/your_name/project_name/AndroidKeyboardAdjust

copy from where?

https://github.com/zubricky/react-native-android-keyboard-adjust/tree/master/android/src/main/java/net/zubricky/AndroidKeyboardAdjust

Still showing following error
A problem occurred evaluating project ':react-native-android-keyboard-adjust'.Could not find method compile() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

P.S it works if i change compile to implementation in node_modules build.gradle

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

7 participants