简体   繁体   中英

Including an APK in another project

如何在Android Studio中的项目中添加APK作为依赖项?

You can't do that. Acceptable types are .jar and .aar and internal library project module.

Best you can do is to change the app-module to library module and then include it as depenancy.

You can achieve it as follows:

  1. Open the module-level build.gradle file.
  2. Delete the line for the applicationId . Only an Android app module can define this.
  3. At the top of the file, you should see the following:

    apply plugin: 'com.android.application'

    Change it to the following:

    apply plugin: 'com.android.library'

  4. Save the file and click File > Sync Project with Gradle Files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM