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

[create-expo-module] Could not find method publishing() #28784

Closed
genesisxyz opened this issue May 12, 2024 · 6 comments
Closed

[create-expo-module] Could not find method publishing() #28784

genesisxyz opened this issue May 12, 2024 · 6 comments
Labels
Android CLI Versioned Expo CLI -- `npx expo start` Issue accepted

Comments

@genesisxyz
Copy link

genesisxyz commented May 12, 2024

Summary

I am creating a new local module on a new Expo app with SDK 50.

I created the project with:

bun create expo-app --template tabs@50

And the module (default options) with:

npx create-expo-module --local

What platform(s) does this occur on?

Android

SDK Version

50.0.17

Environment

$ expo run:android
› Building app...
Configuration on demand is an incubating feature.

> Configure project :app
 ℹ️  Applying gradle plugin 'expo-dev-launcher-gradle-plugin' (expo-dev-launcher@3.6.9)

FAILURE: Build failed with an exception.

* Where:
Script '/Users/genesisxyz/dev/react-native/my-app/node_modules/expo-modules-core/android/ExpoModulesCorePlugin.gradle' line: 62

* What went wrong:
A problem occurred evaluating project ':expo'.
> A problem occurred configuring project ':my-module'.
   > Could not find method publishing() for arguments [ExpoModulesCorePlugin_7snpjhp0a6e04yd23p5w5of3b$_run_closure2$_closure5$_closure7@276984e6] on project ':my-module' of type org.gradle.api.Project.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 8s
10 actionable tasks: 8 executed, 2 from cache
Error: /Users/genesisxyz/dev/react-native/my-app/android/gradlew exited with non-zero code: 1
Error: /Users/genesisxyz/dev/react-native/my-app/android/gradlew exited with non-zero code: 1
    at ChildProcess.completionListener (/Users/genesisxyz/dev/react-native/my-app/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23)
    at Object.onceWrapper (node:events:632:26)
    at ChildProcess.emit (node:events:517:28)
    at maybeClose (node:internal/child_process:1098:16)
    at ChildProcess._handle.onexit (node:internal/child_process:303:5)
    ...
    at Object.spawnAsync [as default] (/Users/genesisxyz/dev/react-native/my-app/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21)
    at spawnGradleAsync (/Users/genesisxyz/dev/react-native/my-app/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:72:46)
    at Object.assembleAsync (/Users/genesisxyz/dev/react-native/my-app/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:52:18)
    at runAndroidAsync (/Users/genesisxyz/dev/react-native/my-app/node_modules/@expo/cli/build/src/run/android/runAndroidAsync.js:36:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
error: script "android" exited with code 1

Minimal reproducible example

Make a new project with:

bun create expo-app --template tabs@50

Add expo-dev-client with:

npx expo install expo-dev-client 

npx expo prebuild

And make a new module (default options) with:

npx create-expo-module --local

Then compile for Android with:

bun android
@genesisxyz genesisxyz added CLI Versioned Expo CLI -- `npx expo start` needs validation Issue needs to be validated labels May 12, 2024
@expo-bot expo-bot removed the needs validation Issue needs to be validated label May 12, 2024
@byCedric byCedric added Issue accepted Android and removed CLI Versioned Expo CLI -- `npx expo start` labels May 13, 2024
@expo-bot
Copy link
Collaborator

Thank you for filing this issue!
This comment acknowledges we believe this may be a bug and there’s enough information to investigate it.
However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.

@byCedric byCedric added the CLI Versioned Expo CLI -- `npx expo start` label May 13, 2024
@adumat
Copy link

adumat commented May 13, 2024

I fixed the problem temporarily by patching expo-modules-core/android/ExpoModulesCorePlugin.gradle, adding the following line to useExpoPublishing:

ext.useExpoPublishing = {
+  if (!project.plugins.hasPlugin('maven-publish')) {
+    apply plugin: 'maven-publish'
+  }

  project.android {
    publishing {
      singleVariant("release") {
...........

@adumat
Copy link

adumat commented May 13, 2024

i have another issue with ExpoModulesPackageList.java:

> Task :expo:compileDebugKotlin
w: file:///Users/matteo/Projects/sintesi-app-2/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:139:50 No cast needed

> Task :expo:compileDebugJavaWithJavac FAILED
/Users/matteo/Projects/sintesi-app-2/node_modules/expo/android/build/generated/expo/src/main/java/expo/modules/ExpoModulesPackageList.java:46: error: cannot find symbol
      expo.modules.sintesiappgraphview.SintesiAppGraphViewModule.class
                                      ^
  symbol:   class SintesiAppGraphViewModule
  location: package expo.modules.sintesiappgraphview
1 error

FAILURE: Build failed with an exception.

i don't know if can be related with this.

@brentvatne
Copy link
Member

hi there! this is fixed now in #28673 -- the problem is that the module being created was using the sdk 51 version of the module template.

@ljukas
Copy link

ljukas commented May 14, 2024

This still exists @brentvatne. But for me this happens when using non-local modules. In my monorepo that has a expo 50 sdk app I get the same error when building. "Cannot find publishing", it works when doing a local module

@DevDeyvidTav
Copy link

DevDeyvidTav commented May 20, 2024

This is still happening to me. I'm using the following versions:

"expo": "~51.0.8",
"expo-av": "~14.0.5",
"expo-build-properties": "~0.12.1",
 "expo-constants": "~16.0.1",
"expo-linking": "~6.3.1",
"expo-router": "~3.5.14",
"expo-status-bar": "~1.12.1",
✖ Installing module dependencies
Error: npm install exited with non-zero code: 1
    at ChildProcess.completionListener (C:\Users\HASTJW\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\@expo\spawn-async\build\spawnAsync.js:42:23)
    at Object.onceWrapper (node:events:628:26)
    at ChildProcess.emit (node:events:513:28)
    at cp.emit (C:\Users\HASTJW\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (node:internal/child_process:1091:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5)
    ...
    at spawnAsync (C:\Users\HASTJW\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\@expo\spawn-async\build\spawnAsync.js:7:23)
    at installDependencies (C:\Users\HASTJW\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\packageManager.js:9:37)
    at C:\Users\HASTJW\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:86:60  
    at newStep (C:\Users\HASTJW\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\utils.js:21:22)     
    at Command.main (C:\Users\HASTJW\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:85:35) {
  pid: 9996,
  output: [ '', '' ],
  stdout: '',
  stderr: '',
  status: 1,
  signal: null
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android CLI Versioned Expo CLI -- `npx expo start` Issue accepted
Projects
None yet
Development

No branches or pull requests

7 participants