Android Studio Import Apidemo

Source: Internet
Author: User

1.import project, SDK directory: Sdk\samples\android-21\legacy\apidemos,import The next step is OK.

2.error:error:the file name must end with. XML, renaming Add. xml

3.Run app, you may encounter 3 problems:

This issue requires importing the SUPPORTV4 package

New issues arise:

Error:execution failed for task ': App:processdebugmanifest '.
> Manifest merger failed:uses-sdk:minsdkversion 1 cannot be smaller than version 9 declared in library [Com.android.s UPPORT:SUPPORT-V4:25.1.0] D:\androidProject\ApiDemos\app\build\intermediates\exploded-aar\com.android.support\ Support-v4\25.1.0\androidmanifest.xml
Suggestion:use tools:overridelibrary= "android.support.v4" to force usage

The solution is to build.gradle (Module) add in mindSdkVersion :

  defaultConfig {        minSdkVersion 21    }
Exception at this time:
dependencies {
Compile ' com.android.support:support-v4:25.1.0 '
}
修改 support-v4 的版本号为 22.2.1即可。


异常:找不到FloatMath.sqrt(0.125f) 

The FloatMath.sqrt(0.125f) method has been removed from the 6.0 SDK: All methods were removed from the public API in version 23.
Modified compileSdkVersion to 22 (originally 23), while modifying the SUPPORT-V4 version number to 22.2.1

4. Rerun after exception:

The references to these two classes require a system class, all of which are dropped on its contents

Run again, and you're running.

Android Studio Import Apidemo

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.