react-native-colo-loco icon indicating copy to clipboard operation
react-native-colo-loco copied to clipboard

[Android] Ignited app with colo loco breaks when building on AppCenter

Open jvgeee opened this issue 3 years ago • 11 comments

I built a new app with Ignite (love it!), and it builds fine locally.

When I build in Android Studio it works fine. When I build it on AppCenter, it fails and points to Colo Loco:

* Where:
Script '/Users/runner/work/1/s/ThriveBusiness/node_modules/react-native-colo-loco/scripts/android.groovy' line: 17

* What went wrong:
A problem occurred evaluating settings 'android'.
> /Users/runner/work/1/app does not exist.

The only non-standard part of my Ignite setup is that I use /src instead of /app for my JS folder. I've tried both of these in settings.gradle

apply from: '../node_modules/react-native-colo-loco/scripts/android.groovy'
linkColocatedNativeFiles([
  appPath: "../app", // also tried using "../src"
  appPackageName: "com.myappname",
  androidPath: "./android/app/src/main/java/com/myappname"
])

I can see that whatever I change this appPath to is what comes out in the AppCenter build error as not existing, e.g. if I make it ../app it will say > /Users/runner/work/1/app does not exist., and if I do ../src it will say > /Users/runner/work/1/src does not exist.

May be a clue. Either way, I've opted to remove colo loco from my project for now.

jvgeee avatar Dec 23 '21 21:12 jvgeee

I experienced this also, my Appcenter Android build fails because of this package, I opted to remove this also from my project.

This is what comes out from the log.

FAILURE: Build failed with an exception.

* Where:
Script '/Users/runner/work/1/s/node_modules/react-native-colo-loco/scripts/android.groovy' line: 17

* What went wrong:
A problem occurred evaluating settings 'android'.
> /Users/runner/work/1/app does not exist.

ardasatata avatar Dec 27 '21 10:12 ardasatata

Does it work if the source code is put in an app folder?

a7medev avatar Dec 27 '21 10:12 a7medev

Does it work if the source code is put in an app folder?

Not sure what you're mean, but here's how I arrange my project folder.

also, I didn't really use this package cuz It was just bundled with ignite.

Screen Shot 2021-12-27 at 19 19 04

Anyway, my appcenter build are back running right now after I remove it from package.json. for those who has the same problem make sure to remove some related line from settings.gradle & Podfile

ardasatata avatar Dec 27 '21 11:12 ardasatata

I created a new Ignite app and tried building it in AppCenter to figure out where the problem is and looks like it's because of the System.getProperty('user.dir') resolving to the app root /Users/runner/work/1/s instead of /Users/runner/work/1/s/android, I guess we should find a better way to get the current directory because the System.getProperty('user.dir') is relative to where the build command is executed.

a7medev avatar Dec 27 '21 12:12 a7medev

Is it possible to cd into the app folder in your App Center build script before running the app? Running it from the parent folder seems a little odd to me.

jamonholmgren avatar Jan 19 '22 19:01 jamonholmgren

+1 I'm setting up App Center right now and just ran into this issue myself.

richard-grilla avatar Mar 03 '22 20:03 richard-grilla

I'd love help resolving this, if anyone has ideas!

jamonholmgren avatar Apr 15 '22 00:04 jamonholmgren

I'm not sure why this happens to be the case, but maybe we can try using rootDir instead of System.getProperty('user.dir').

a7medev avatar Apr 15 '22 11:04 a7medev

Hi everyone i have a problem like it can someone help me to solve it? Please image image

tranduy1401384 avatar Sep 11 '22 06:09 tranduy1401384

Hi everyone i have a problem like it can someone help me to solve it? Please image image

Could you check your gradle?, this discussion is mainly for those who have an issue during build on App Center & seems like you just have an issue with your gradle

ardasatata avatar Sep 11 '22 16:09 ardasatata

Hi everyone i have a problem like it can someone help me to solve it? Please image image

Could you check your gradle?, this discussion is mainly for those who have an issue during build on App Center & seems like you just have an issue with your gradle

thanks bro. i'm trying to fix it.

tranduy1401384 avatar Sep 13 '22 07:09 tranduy1401384