Can't build android project after detaching from Expo SDK 28.0.0

Hi all,

I updated Expo SDK to version 28.0.0 from version 27.0.1 and everything seems fine. But after i ran ‘exp detach’ and tried opening android project in Android Studio i get this error.

Project with path ':expoview' could not be found in project ':app'.

It seems that this one line in app/build.gradle is messing something up…

compile project(path: ':expoview')

Have you met with this? Am i doing something wrong? Can you please help me? Thanks!

Good Morning @altamira

Check This

Hey @victorwads, i looked at that issue but i don see any line in app/build.gradle that says:

implementation(project(path: ':expoview')) {
  // Excluding okhttp3 included by expo-file-system
  exclude group: 'com.squareup.okhttp3', module: 'okhttp'
  exclude group: 'com.squareup.okhttp3', module: 'okhttp-urlconnection'

This code is from SDK 29.

On SDK 28 will look like this:

// Remove It
compile project(path: ':expoview')
// Add It

Ps.: On SDK 29 Gradle Plugin was updated. All compile keywords are changed to implementation

Great, thanks for clarification! But i already have lines that says this:

compile('host.exp.exponent:expoview:28.0.0@aar') {
  transitive = true
compile project(path: ':expoview')

So just to be clear, if i remove this

compile project(path: ':expoview')

all should be working right?

@altamira, Yes

@victorwads I got another error after removing that line so i think it will be easier just to update SDK to version 29…

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:exponentPrebuildStep'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(
	at org.gradle.internal.Transformers$4.transform(
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(
	at org.gradle.internal.concurrent.StoppableExecutorImpl$
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command './android/detach-scripts/''
	at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(
	at org.gradle.process.internal.DefaultExecHandle.failed(
	... 5 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not start './android/detach-scripts/'
	at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(
	at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(
	... 5 more
Caused by: Cannot run program "./android/detach-scripts/" (in directory "/Users/tomassykora/Dev/react-native/coach-rufus"): error=2, No such file or directory
	at java.lang.ProcessBuilder.start(
	at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(
	... 7 more
Caused by: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(
	at java.lang.ProcessImpl.start(
	at java.lang.ProcessBuilder.start(
	... 8 more

This problem is normally caused when Android Stuido can’t find exp executable.

Do you have: (to install exp CLI on your system.)

$ npm i -g exp

Do you have: (to add exp executable path on system PATH.)

$ exp path

@victorwads Yes, of course, because i wouldn’t be able to detach in the first place via the ‘exp detach’ command.

@altamira, to test this try to run on terminal exp command outside of your project. like:
open a new terminal instance

$ cd /
$ exp

If you want send me inbox on messenger, let’s figure it out together.

1 Like

@victorwads, exp is working outside my project folder. I upgraded to SDK 29 and it seems it’s working correctly now. Didn’t know that SDK v29 was already out. Thanks for helping me!

@altamira, follow this:

@victorwads Had to downgrade to SDK 28 after all, because then onesignal plugin failed because of updated gradle plugin… I’m going to pull my hair out…

@victorwads wrote you via messenger :slight_smile:

1 Like

I Made a Gist with some infos :point_down:

1 Like

I have the same problem with detaching expo sdk 27.0 and I found that my myProject/.expo-source/android/ is empty, that’s why gradle cannot run the script from the given path.


This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.