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


#1

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!


#2

Good Morning @altamira

Check This


Problem with detaching
#3

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'
}

#4

@altamira
This code is from SDK 29.

On SDK 28 will look like this:

// Remove It
compile project(path: ':expoview')
// Add It
compile('host.exp.exponent:expoview:28.0.0@aar')

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


#5

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?


#6

@altamira, Yes


#7

@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(ExecuteActionsTaskExecuter.java:84)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
	at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command './android/detach-scripts/run-exp.sh''
	at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:198)
	at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:329)
	at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)
	... 5 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not start './android/detach-scripts/run-exp.sh'
	at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
	at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
	at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:68)
	... 5 more
Caused by: java.io.IOException: Cannot run program "./android/detach-scripts/run-exp.sh" (in directory "/Users/tomassykora/Dev/react-native/coach-rufus"): error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
	... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 8 more

#8

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

#9

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


#10

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

$ cd /
$ exp

#11

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


#12

@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!


#13

@altamira, follow this:



#14

@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…


#15

@victorwads wrote you via messenger :slight_smile:


#16

I Made a Gist with some infos :point_down:


Cant change Detached app name
#17

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.


closed #18

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