Android(安卓)Studio入门之常见问题
16lz
2021-12-04
将Github工程导入Android Studio后,sync代码时报找不到'com.android.application' 的错误
build.gradle示例:
apply plugin: 'com.android.application'android { compileSdkVersion 23 buildToolsVersion "23.0.1" defaultConfig { applicationId "com.sample.test" minSdkVersion 8 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }}dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:support-v4:23.1.1'}
gradle版本导致的问题,解决方法,在文件顶层加上
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' }}
更多相关文章
- Spring for Android(安卓)探究
- 使用Eclipse开发Android时整个工程或第三方jar包的正确使用
- Spring for Android(安卓)探究
- Android(安卓)studio导入Android(安卓)studio项目出错
- Android中VectorDrawableCompat的使用注意事项
- Android(安卓)Jni代码示例讲解
- Android(安卓)统计图表引擎 AChartEngine(三) - 示例源码折线图
- TableLayout常用细节
- Android关机重启实现