- 
                Notifications
    
You must be signed in to change notification settings  - Fork 18
 
Open
Description
처음에 도입했다가 뭔가 업그레이드 하면서 해결되어서 삭제 했다가 SDK33으로 올리니까 다시 발생해서 추가
윈도우에서는 안돌아가는 커맨드라 OS 구분
dx가 없고 d8이 있는데 dx를 찾으려고 해서 link 파일을 만들어주는 것이다
app/build.gradle
def migrateToDx() {
     def buildToolPath = "${android.sdkDirectory.path}/build-tools/${buildToolsVersion}"
     println "BuildToolPath: ${buildToolPath}"
     def d8Path = "${buildToolPath}/d8"
     def dXPath = "${buildToolPath}/dx"
     def command = "ln -sf ${d8Path} ${dXPath}"
     exec {
         commandLine command.split()
     }
     println "dx to d8 link Created: ${dXPath}"
     def d8JarPath = "${buildToolPath}/lib/d8.jar"
     def dXJarPath = "${buildToolPath}/lib/dx.jar"
     command = "ln -sf ${d8JarPath} ${dXJarPath}"
     exec {
         commandLine command.split()
     }
     println "dx.jar to d8.jar link Created: ${dXJarPath}"
 }
android {
    ...
    if (System.getProperty('os.name').toLowerCase().contains('linux')) {
         migrateToDx()
    }
}
Metadata
Metadata
Assignees
Labels
No labels