2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AndroidStudio4.2でSystemアプリをビルドするときのメモ

Last updated at Posted at 2021-05-12

起きたこと

Android Studio4.2にしたらSystemAppのビルドができなくなった

解決法

AS4.2未満

プロジェクトルートのbuild.gradleに

build.gradle
allprojects {
// その他のコードがこの上に入る
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs.add('-Xbootclasspath/p:app/framework/framework.jar')
//          ここのPathはそれぞれframework.jarをおいている環境に合わせる
        }
    }
}

AS4.2以上

プロジェクトルートのbuild.gradleに

build.gradle
allprojects {
// その他のコードがこの上に入る
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            Set<File> fileSet = options.bootstrapClasspath.getFiles()
            List<File> newFileList =  new ArrayList<>();
            newFileList.add(new File("./app/framework/framework.jar"))
//          ここのPathはそれぞれframework.jarをおいている環境に合わせる
            newFileList.addAll(fileSet)
            options.bootstrapClasspath = files(
                    newFileList.toArray()
            )
        }
    }
}
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?