Android Studio Solution unspecified on Project app resolves to an APK archive which are not supported

Source: Internet
Author: User

This problem occurs when the unspecified on Project apps resolves to an APK archive which are not supported as a compilation dependency the case may be: created two m Odule, where one module relies on another module and causes the problem to occur;

If in Android studio, there are Modulea and Moduleb, we want Modulea to rely on Moduleb, run time may appear this problem, view the Moduleb of the build.gradle of dependency, inside can see:

Apply plugin: ' Com.android.application '
This sentence tells the Gradle will Moduleb compile called application, that is, APK, this is the problem;

Workaround: Replace the above sentence with the following:

Apply plugin: ' Com.android.library '
At this point, Gradle will compile called a library, that is, libraries, after running, if this problem occurs: Error:library projects cannot set ApplicationID. ApplicationID is set to ' package_name ' in Default Config., that is because a library does not allow the setting of ApplicationID, you need to BUILDE.GRADLE-ANDROID-DEFAULTC Onfig in the ApplicationID delete;

If we moduleb still need to generate APK, then we need to put the common code in a module, as a support library;

Android Studio Solution unspecified on Project app resolves to an APK archive which are not supported

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.