infinitered / ignite-bowser

Bowser is now re-integrated into Ignite CLI! Head to https://github.com/infinitered/ignite to check it out.
https://infinite.red/ignite
MIT License
615 stars 140 forks source link

App won't build just after ignite #381

Closed jeremyhalin closed 3 years ago

jeremyhalin commented 3 years ago

What's going on?

Can't build app on Android (iOS not tested). I just ignite the app. Here is the error log when I react-native run-android :

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1103 file(s) to forward-jetify. Using 16 workers...
info Starting JS server...
info Installing the app...
File C:\Users\Jeremy\.android\repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 29.0.3 in C:\Users\Jeremy\AppData\Local\Android\Sdk\licenses
License for package Android SDK Build-Tools 29.0.3 accepted.
Preparing "Install Android SDK Build-Tools 29.0.3 (revision: 29.0.3)".
"Install Android SDK Build-Tools 29.0.3 (revision: 29.0.3)" ready.
Installing Android SDK Build-Tools 29.0.3 in C:\Users\Jeremy\AppData\Local\Android\Sdk\build-tools\29.0.3
"Install Android SDK Build-Tools 29.0.3 (revision: 29.0.3)" complete.
"Install Android SDK Build-Tools 29.0.3 (revision: 29.0.3)" finished.
> Task :react-native-keychain:generateDebugRFile FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
40 actionable tasks: 2 executed, 38 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-keychain:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-keychain:debugRuntimeClasspath'.
   > Failed to transform appcompat-1.1.0.aar (androidx.appcompat:appcompat:1.1.0) to match attributes {artifactType=android-symbol-with-package-name, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for ExtractAarTransform: C:\Users\Jeremy\.gradle\caches\modules-2\files-2.1\androidx.appcompat\appcompat\1.1.0\351d3409fe51f3d862bd2b1bcc0f3b6ded29460e\appcompat-1.1.0.aar.
         > invalid entry CRC (expected 0x1de6f3ba but got 0x4d03f44)

* 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

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to reproduce

  1. ignite new App
  2. cd App
  3. react-native run-android

ignite doctor results:

System
  platform           win32         
  arch               x64           
  cpu                16 cores       AMD Ryzen 7 2700X Eight-Core Processor
  directory          App            C:\Users\Jeremy\www\App

JavaScript
  node               14.8.0       C:\Program Files\nodejs\node.EXE
  npm                6.14.7       C:\Program Files\nodejs\npm.CMD
  yarn               1.22.5       C:\Users\Jeremy\AppData\Roaming\npm\yarn.CMD

Ignite
  ignite-cli           3.5.3              C:\Users\Jeremy\AppData\Local\Yarn\bin\ignite.CMD
  ignite src           build              C:\Users\Jeremy\AppData\Local\Yarn\Data\global\node_modules\ignite-cli\build
  navigation           react-navigation  
  generators                             
                       component          ignite-bowser
                       model              ignite-bowser
                       navigator          ignite-bowser
                       screen             ignite-bowser
  createdWith          3.5.3             
  boilerplate          ignite-bowser     
  boilerplateVersion   5.4.1             

Android
  java               -            C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.EXE
  android home       -            C:\Users\Jeremy\AppData\Local\Android\Sdk
silencer07 commented 3 years ago

I am coming from fresh install of everything(ignite, npm and it works on my end)

jeremyhalin commented 3 years ago

I did nothing special. Is it possible that there is a conflict with my other React native projects?

Do I have some caches to clear?

I don't understand the build error.

jeremyhalin commented 3 years ago

I am coming from fresh install of everything(ignite, npm and it works on my end)

By the way, which template did you choose? I chose Bowser

silencer07 commented 3 years ago

Failed to transform appcompat-1.1.0.aar (androidx.appcompat:appcompat:1.1.0) to match attributes {artifactType=android-symbol-with-package-name, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}. Execution failed for ExtractAarTransform: C:\Users\Jeremy.gradle\caches\modules-2\files-2.1\androidx.appcompat\appcompat\1.1.0\351d3409fe51f3d862bd2b1bcc0f3b6ded29460e\appcompat-1.1.0.aar. invalid entry CRC (expected 0x1de6f3ba but got 0x4d03f44)

Maybe try deleting the gradle caches. I suppose you are using global gradle. The recommended way is using the gradle wrapper(hence the ./gradlew file)

jeremyhalin commented 3 years ago

It's now working, I don't really know why.

I did these steps :