react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

7.0.5: run-android failed but succeeded after removing the code push module

Open emclab opened this issue 2 years ago • 0 comments

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Steps to Reproduce

  1. not sure how to reproduce it

Expected Behavior

What you expected to happen? compile with react-native run-android succeeds.

Actual Behavior

I am in the process of migrating React Native 0.68 app from Intel silicon to M1 silicon with Android Studio 2021.2.1 Patch 1. What I did is after installing all modules with test of react-native run-android, then copy the source code over. But after copying source code, npx react-native run-android starts to throw error:

w: /Users/macair/Documents/code/js/xyz_app6/node_modules/react-native-screens/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt: (7, 54): Parameter 'height' is never used

> Task :app:compileDebugJavaWithJavac FAILED
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
260 actionable tasks: 254 executed, 6 up-to-date
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/macair/Documents/code/js/xyz_app6/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/macair/Documents/code/js/xyz_app6/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Compilation with Kotlin compile daemon was not successful
java.rmi.ServerError: Error occurred in server thread; nested exception is: 
    java.lang.AssertionError: symbolic reference class is not accessible: class sun.nio.ch.FileChannelImpl, from class org.jetbrains.kotlin.com.intellij.util.io.FileChannelUtil (unnamed module @2c8b1039)
    at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:389)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
    at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:598)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:844)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:721)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:720)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
    at java.rmi/sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:304)
    at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:280)
    at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:166)
GC: G1 Young Generation, G1 Old Generation

......

Note: /Users/macair/Documents/code/js/xyz_app6/android/app/src/debug/java/com/xyz_app6/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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 48s

    at makeError (/Users/macair/Documents/code/js/xyz_app6/node_modules/execa/index.js:174:9)
    at /Users/macair/Documents/code/js/xyz_app6/node_modules/execa/index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (/Users/macair/Documents/code/js/xyz_app6/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/Users/macair/Documents/code/js/xyz_app6/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.

Here is the output of react-native info:

System:
    OS: macOS 12.5
    CPU: (8) arm64 Apple M1
    Memory: 122.14 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.7.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.15.0 - /opt/homebrew/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.0, iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0
    Android SDK:
      API Levels: 29, 30, 31, 32, 33
      Build Tools: 30.0.2, 31.0.0, 33.0.0
      System Images: android-33 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: 14.0/14A5270f - /usr/bin/xcodebuild
  Languages:
    Java: 18.0.2 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.2 => 0.68.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

I also delete node_modules and yarn install, the error is the same. However the run-android succeeded after yarn remove react-native-code-push. BTW build on Xcode succeeded after removing the code push module as well.

Here is part of package.json:

  "dependencies": {
    "@ethersproject/shims": "^5.6.0",
    "@react-native-community/toolbar-android": "^0.2.1",
    "@react-native-masked-view/masked-view": "^0.2.7",
    "@react-native-picker/picker": "^2.4.3",
    "@react-navigation/native": "^6.0.11",
    "@react-navigation/stack": "^6.2.2",
    "crypto-js": "^4.1.1",
    "ethers": "^5.6.9",
    "react": "17.0.2",
    "react-native": "0.68.2",
    "react-native-blob-util": "^0.16.2",
    "react-native-confirmation-code-field": "^7.3.0",
    "react-native-device-info": "^10.0.2",
    "react-native-easy-grid": "^0.2.2",
    "react-native-elements": "^3.4.2",
    "react-native-encrypted-storage": "^4.0.2",
    "react-native-gesture-handler": "^2.5.0",
    "react-native-gifted-chat": "^1.0.4",
    "react-native-image-picker": "^4.8.4",
    "react-native-loading-spinner-overlay": "^3.0.1",
    "react-native-modal": "^13.0.1",
    "react-native-reanimated": "^2.9.1",
    "react-native-redash": "^18.0.0",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "^4.3.1",
    "react-native-screens": "^3.15.0",
    "react-native-vector-icons": "^9.2.0",
    "rn-alioss": "^0.2.5",
    "socket.io-client": "^4.5.1"
  },
  "devDependencies": {
    "@babel/core": "^7.18.9",
    "@babel/runtime": "^7.18.9",
    "@react-native-community/eslint-config": "^3.0.3",
    "babel-jest": "^28.1.3",
    "eslint": "^8.20.0",
    "jest": "^28.1.3",
    "metro-react-native-babel-preset": "^0.71.3",
    "react-test-renderer": "17.0.2"
  },

What actually happens?

  STACK TRACE AND/OR SCREENSHOTS

Reproducible Demo

  • Download https://github.com/microsoft/react-native-code-push/archive/master.zip and unzip. From Examples folder run node create-app.js appName [email protected] [email protected] command to generate plain CodePushified React Native app. Please see description on top of create-app.js file content if needed
  • If you can't reproduce the bug on it, provide us as much info as possible about your project

Environment

  • react-native-code-push version:7.0.5
  • react-native version:0.68.2
  • iOS/Android/Windows version:
  • Does this reproduce on a debug build or release build?
  • Does this reproduce on a simulator, or only on a physical device?

(The more info the faster we will be able to address it!)

emclab avatar Aug 11 '22 20:08 emclab