Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build-tool 31.0.0 is missing DX #109

Open
2sem opened this issue May 12, 2023 · 0 comments
Open

Build-tool 31.0.0 is missing DX #109

2sem opened this issue May 12, 2023 · 0 comments

Comments

@2sem
Copy link

2sem commented May 12, 2023

처음에 도입했다가 뭔가 업그레이드 하면서 해결되어서 삭제 했다가 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()
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant