OneKeyHQ / app-monorepo

Secure, open source and community driven crypto wallet runs on all platforms and trusted by millions.
https://onekey.so
Other
1.96k stars 372 forks source link

APK is not generateing [BUG]: #2252

Closed harmit001 closed 1 year ago

harmit001 commented 1 year ago

I was trying to generate the APK for testing but not able to generate it. I have a review the guideline but not able to find the steps.

loatheb commented 1 year ago

Hi @harmit001 For APK generate, please take a look at our release-android job.

harmit001 commented 1 year ago

@loatheb Thankyou for your help I have a follow that steps But now I am facing an error "You must have access to the onekeyhq account to run this " so where I can create an account of onekeyhq account. can you please share the link.

https://prnt.sc/t02a_5IH1NGj

loatheb commented 1 year ago

We are using https://expo.dev/ for native build service. Please check docs, change APP Name and retry.

harmit001 commented 1 year ago

@loatheb we are facing this error in expo. please guide us.


Downloading https://services.gradle.org/distributions/gradle-7.5.1-all.zip
Unzipping /home/expo/.gradle/wrapper/dists/gradle-7.5.1-all/1ehga6e77gqps5uk2kc5kf1vc/gradle-7.5.1-all.zip to /home/expo/.gradle/wrapper/dists/gradle-7.5.1-all/1ehga6e77gqps5uk2kc5kf1vc
Set executable permissions for: /home/expo/.gradle/wrapper/dists/gradle-7.5.1-all/1ehga6e77gqps5uk2kc5kf1vc/gradle-7.5.1/bin/gradle
Welcome to Gradle 7.5.1!
Here are the highlights of this release:
 - Support for Java 18
- Support for building with Groovy 4
 - Much more responsive continuous builds
 - Improved diagnostics for dependency resolution
For more details see https://docs.gradle.org/7.5.1/release-notes.html
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.5.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
[stderr] (node:2978) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /home/expo/workingdir/build/node_modules/yaml/package.json.
[stderr] Update this package.json to use a subpath pattern like "./*".
[stderr] (Use `node --trace-deprecation ...` to show where the warning was created)
> Task :react-native-gradle-plugin:compileKotlin
'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version.
> Task :react-native-gradle-plugin:pluginDescriptors
> Task :react-native-gradle-plugin:processResources
> Task :react-native-gradle-plugin:compileKotlin
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (10, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (119, 30): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (135, 26): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (155, 32): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (161, 31): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (169, 36): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt: (100, 48): 'reactRoot: DirectoryProperty' is deprecated. reactRoot was confusing and has been replace with rootto point to your root project and reactNativeDir to point to the folder of the react-native NPM package
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (10, 37): 'ApplicationVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (11, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (12, 37): 'LibraryVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (28, 51): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (131, 12): 'ApplicationVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (132, 12): 'LibraryVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (252, 14): 'BaseVariant' is deprecated. Deprecated in Java
> Task :react-native-gradle-plugin:compileJava
[stderr] Note: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/java/com/facebook/react/codegen/generator/SchemaJsonParser.java uses or overrides a deprecated API.
[stderr] Note: Recompile with -Xlint:deprecation for details.
> Task :react-native-gradle-plugin:classes
> Task :react-native-gradle-plugin:inspectClassesForKotlinIC
> Task :react-native-gradle-plugin:jar
> Configure project :app
App Version: 3.23.0
App Version Code: 1
defaultConfig whenTaskAdded
false
> Configure project :expo-application
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-av
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-barcode-scanner
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-camera
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-clipboard
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-constants
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-device
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-file-system
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-font
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-haptics
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-image-loader
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-image-manipulator
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-image-picker
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-intent-launcher
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-keep-awake
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-linear-gradient
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-local-authentication
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-localization
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-location
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-media-library
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-modules-core
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-notifications
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-secure-store
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo-splash-screen
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :expo
Using expo modules
  - expo-application (4.1.0)
  - expo-av (11.2.3)
  - expo-barcode-scanner (11.3.0)
  - expo-camera (12.2.0)
  - expo-clipboard (3.0.1)
  - expo-constants (13.1.1)
  - expo-device (4.3.0)
  - expo-file-system (14.0.0)
  - expo-font (10.1.0)
  - expo-haptics (11.2.0)
  - expo-image-loader (3.2.0)
  - expo-image-manipulator (10.4.0)
  - expo-image-picker (13.1.1)
  - expo-intent-launcher (10.2.0)
  - expo-keep-awake (10.1.1)
  - expo-linear-gradient (11.3.0)
  - expo-local-authentication (12.2.0)
  - expo-localization (13.0.0)
  - expo-location (14.2.2)
  - expo-media-library (14.1.0)
  - expo-modules-core (0.9.2)
  - expo-notifications (0.15.4)
  - expo-secure-store (11.2.0)
  - expo-splash-screen (0.15.1)
  - react-native-v8$expo (1.6.0)
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Configure project :lottie-react-native
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
Checking the license for package Android SDK Build-Tools 30.0.3 in /home/expo/Android/Sdk/licenses
License for package Android SDK Build-Tools 30.0.3 accepted.
Preparing "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)".
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" ready.
Installing Android SDK Build-Tools 30.0.3 in /home/expo/Android/Sdk/build-tools/30.0.3
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" complete.
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" finished.
Checking the license for package Android SDK Platform 33 in /home/expo/Android/Sdk/licenses
License for package Android SDK Platform 33 accepted.
Preparing "Install Android SDK Platform 33 (revision: 2)".
"Install Android SDK Platform 33 (revision: 2)" ready.
Installing Android SDK Platform 33 in /home/expo/Android/Sdk/platforms/android-33
"Install Android SDK Platform 33 (revision: 2)" complete.
"Install Android SDK Platform 33 (revision: 2)" finished.
> Configure project :react-native-firebase_analytics
:react-native-firebase_analytics package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/analytics/package.json
:react-native-firebase_app package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_analytics:firebase.bom using custom value: 29.2.1
:react-native-firebase_analytics package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/analytics/package.json
:react-native-firebase_analytics:version set from package.json: 14.12.0 (14,12,0 - 14012000)
:react-native-firebase_analytics:android.compileSdk using custom value: 33
:react-native-firebase_analytics:android.targetSdk using custom value: 33
:react-native-firebase_analytics:android.minSdk using custom value: 23
:react-native-firebase_analytics:reactNativeAndroidDir /home/expo/workingdir/build/node_modules/react-native/android
> Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:firebase.bom using custom value: 29.2.1
:react-native-firebase_app:play.play-services-auth using default value: 20.3.0
:react-native-firebase_app package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:version set from package.json: 14.12.0 (14,12,0 - 14012000)
:react-native-firebase_app:android.compileSdk using custom value: 33
:react-native-firebase_app:android.targetSdk using custom value: 33
:react-native-firebase_app:android.minSdk using custom value: 23
:react-native-firebase_app:reactNativeAndroidDir /home/expo/workingdir/build/node_modules/react-native/android
> Configure project :react-native-firebase_crashlytics
:react-native-firebase_crashlytics package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/crashlytics/package.json
:react-native-firebase_app package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_crashlytics:firebase.bom using custom value: 29.2.1
:react-native-firebase_crashlytics package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/crashlytics/package.json
:react-native-firebase_crashlytics:version set from package.json: 14.12.0 (14,12,0 - 14012000)
:react-native-firebase_crashlytics:android.compileSdk using custom value: 33
:react-native-firebase_crashlytics:android.targetSdk using custom value: 33
:react-native-firebase_crashlytics:android.minSdk using custom value: 23
:react-native-firebase_crashlytics:reactNativeAndroidDir /home/expo/workingdir/build/node_modules/react-native/android
> Configure project :react-native-firebase_perf
:react-native-firebase_perf package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/perf/package.json
:react-native-firebase_app package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_perf:firebase.bom using custom value: 29.2.1
:react-native-firebase_perf package.json found at /home/expo/workingdir/build/node_modules/@react-native-firebase/perf/package.json
:react-native-firebase_perf:version set from package.json: 14.12.0 (14,12,0 - 14012000)
:react-native-firebase_perf:android.compileSdk using custom value: 33
:react-native-firebase_perf:android.targetSdk using custom value: 33
:react-native-firebase_perf:android.minSdk using custom value: 23
:react-native-firebase_perf:reactNativeAndroidDir /home/expo/workingdir/build/node_modules/react-native/android
> Configure project :react-native-flipper
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
Checking the license for package Android SDK Build-Tools 33 in /home/expo/Android/Sdk/licenses
License for package Android SDK Build-Tools 33 accepted.
Preparing "Install Android SDK Build-Tools 33 (revision: 33.0.0)".
"Install Android SDK Build-Tools 33 (revision: 33.0.0)" ready.
Installing Android SDK Build-Tools 33 in /home/expo/Android/Sdk/build-tools/33.0.0
"Install Android SDK Build-Tools 33 (revision: 33.0.0)" complete.
"Install Android SDK Build-Tools 33 (revision: 33.0.0)" finished.
> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Android gradle plugin: 7.3.1
Gradle: 7.5.1
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
[stderr] FAILURE:
[stderr] Build failed with an exception.
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/node_modules/react-native-v8/android/build.gradle' line: 50
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':react-native-v8'.
[stderr] > Please disable Hermes because Hermes will transform the JavaScript bundle as bytecode bundle.
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
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.5.1/userguide/command_line_interface.html#sec:command_line_warnings
[stderr] BUILD FAILED in 3m 12s
6 actionable tasks: 6 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
sunnylqm commented 1 year ago

We are using v8 engine on android. Hermes is not supported

rayston92 commented 1 year ago

We are using v8 engine on android. Hermes is not supported

hey @sunnylqm , would you kindly point this out on our readme doc, so others won't get lost when building.

sunnylqm commented 1 year ago

The default config is v8 so we never expect to see this error unless he changed it intentionally. Any modified config may lead to an error that we have no idea at all.

danieladebanjo55 commented 1 year ago

I followed every instruction in your documentation and yet the build failed. You guys can help by making a video or create a document explaining the right way to do this(Using Images to get better visualization ). I've not been able to build an apk file for about 2 weeks now and it's really hindering the learning and research. @loatheb @sunnylqm please can you look into this?

sunnylqm commented 1 year ago

@danieladebanjo55 you should post the error you met in a new issue. We may write down a normal flow which is working for us as "Step A - B -C", but maybe it's totally different for you as we have totally different system environments and you may need some extra steps that we did not realise at all. We could never know what are missing unless we saw the errors.

Take the error above as an example:

[stderr] > Please disable Hermes because Hermes will transform the JavaScript bundle as bytecode bundle.

We never met this error and we can only assume it's because he turned on hermes engine as we do not have a repro step from the information he provided.

danieladebanjo55 commented 1 year ago
Screen Shot 2023-01-10 at 5 47 13 AM

@sunnylqm here is the error i'm getting and i just forked the repo, renamed the app in the app.json file and ran the release android workflow. Also please how do i disable hermes(I dont seem to get that part)?

sunnylqm commented 1 year ago

@danieladebanjo55 This error is because the entry file is not a default "index.js", so you need to specify it with the ENTRY_FILE env variable. I've updated the readme accordingly https://github.com/OneKeyHQ/app-monorepo/pull/2379/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R75

danieladebanjo55 commented 1 year ago

Thanks alot for this @sunnylqm and i appreciate the quick response as well, i followed the new instruction you gave(i ran it on local). it gave me a new error; i will share the details

Screen Shot 2023-01-10 at 2 31 10 PM

can you help me with this

sunnylqm commented 1 year ago

You need to scroll up a little bit as i can not see where the error is. If the error is about node_modules/fs just delete that folder rm -rf node_modules/fs.(We will fix it later in a more stable way)

danieladebanjo55 commented 1 year ago

Thanks @sunnylqm it's working now. Thanks for the help