Skip to content

Conversation

@williscool
Copy link
Owner

@williscool williscool commented Oct 11, 2023

  • typescript working
  • some stuff that should work for a native module but doesn't...

tried to follow

to no avail

https://reactnative.dev/docs/0.72/native-modules-intro

tried everything I could from

facebook/react-native#26813

but no dice.

also tried to make my stuff look like example app

https://github.com/facebook/react-native/blob/v0.72.5/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java

no dice :(

@williscool
Copy link
Owner Author

blocked by

facebook/react-native#26813

@williscool williscool changed the title feat/rn list events feat/rn list events through bridge Oct 11, 2023
williscool added a commit that referenced this pull request Oct 14, 2023
* bring over stuff that looks good from standard native modules attempt

#10

* expo config setup init

MAN THAT WAS HARD!

had to

- downgrade react-native to 0.71
- upgrade kotlin to 1.8
- downgrade gradle to 7.6
- change the location of @react-native/gradle-plugin  to
  react-native-gradle-plugin
- setup the expo config to use the hermes compiler (not mention in doc
    :/ )

facebook/react-native#38179

expo/expo#22008

* missed a spot

* got everything running with no errors

ran into this ugly one called

java.lang.IllegalStateException: Current Activity is of incorrect class,
expected AppCompatActivity, received ui.MyReactActivity

hard to debug for real for real.

ended up looking into expo docs that said they are getting rid of the
bare instructions

and then

expo/expo#18022

then that had me be like where is that erorr even from...

which lead me to git blame

packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/AppContext.kt

which lead me to

expo/expo#19573

which lead me to

s/Activity/AppCompatActivity/g

in

android/app/src/main/java/com/github/quarck/calnotify/ui/MyReactActivity.kt

* fix: forgot to switch to matching gradle version for android build plugin

* def don't need react native picker

hope we don't need expo install modules either

* kinda crazy but got a (mostly) WORKING NATIVE MODULE!

in

modules/my-module/android/src/main/java/expo/modules/mymodule/MyModule.kt

Constants, Events, and AsyncFunction work beautifully!

View seems to work but I don't really understand it

weirdly Function DOES NOT WORK AT ALL!!!

it just says is not a function and since it seemed like the easiest
thing and was what I looked at first it made me thing everything else
was broken too :/

lost A LOT of time to that

* Logcat instead of println and hello on button press

* document why chrome debugging doesn't work as expected by default

to save myself time in the future

* debugging with vscode works!!!!

unfortunately debugging syncronous native modules in it does not :/

* more docs on debugging

* react-native-devsettings because why not

* flipper setup again because why not?

* drop a android studio thing that didn't work

* fix readme

* drop a dependency we dont need that had a peer dependency that broke shit

expo-module-scripts 3.1.0 depends on @expo/config 7.5 which breaks shit

* Revert "flipper setup again because why not?"

turns out it breaks build. like flipper but not worth build break

This reverts commit 8612ff3.

* do still want to set entryFile though
@williscool
Copy link
Owner Author

Closing in favor of #12 which actually works lol

@williscool williscool closed this Oct 14, 2023
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

Successfully merging this pull request may close these issues.

2 participants