kai*_*-dj 2 android android-hardware android-studio android-api-levels
我正在尝试使用Gingerbread,api 10为我的(非常)旧Android手机开发应用程序.
但是使用android studio作为IDE,问题似乎永远存在:
minSdkVersion 10 cannot be smaller than version 14 declared in libraryimplementation 'com.android.support:appcompat-v7:26.1.0'改为implementation 'com.android.support:appcompat-v7:25.1.0'......这就是我不知道如何继续下去的观点
正如我所想,这不可能是真的,一个项目抛出了manny错误,我没有创建一个单独的类并且没有编写一行代码,我尝试从命令行构建.
它有效,但我习惯了IDE功能,不喜欢错过它们.所以我的问题是:
如何使用android studio为api级别开发一个简单的Android应用程序?
是否有指导将项目安装到api 10?
我是否处于"正确"的道路上?
是否有一个api 10级应用程序的骨架项目,我可以导入(好像我可以在项目向导中选择api 10)?
我知道原因,谷歌不再支持api <14了.
我仍然不明白为什么我不能使用我完全健康的硬件.
我仍然希望能够为我的旧手机编写一个简单的应用程序.
¹错误日志:
Information:Gradle tasks [:app:assembleDebug]
/home/aik/.gradle/caches/transforms-1/files-1.1/appcompat-v7-25.1.0.aar/2ab2d76d88a035b2d8a733b1b9a020a8/res/values-v14/values-v14.xml
Error:(8, 5) error: style attribute 'android:attr/textAllCaps' not found.
Error:resource android:style/TextAppearance.Material not found.
Error:resource android:style/TextAppearance.Material.Body1 not found.
Error:resource android:style/TextAppearance.Material.Body2 not found.
/home/aik/test_api10/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v14/values-v14.xml
Error:(5) style attribute 'android:attr/textAllCaps' not found.
Error:resource android:style/TextAppearance.Material.Button not found.
Error:resource android:style/TextAppearance.Material.Caption not found.
Error:resource android:style/TextAppearance.Material.Display1 not found.
Error:resource android:style/TextAppearance.Material.Display2 not found.
Error:resource android:style/TextAppearance.Material.Display3 not found.
Error:resource android:style/TextAppearance.Material.Display4 not found.
Error:resource android:style/TextAppearance.Material.Headline not found.
Error:resource android:style/TextAppearance.Material.Inverse not found.
Error:resource android:style/TextAppearance.Material.Large not found.
/home/aik/test_api10/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v11/values-v11.xml
Error:(6) error: resource android:attr/textColorHighlightInverse not found.
Error:(7) error: resource android:attr/textColorLinkInverse not found.
Error:(12) error: resource android:attr/textColorHighlightInverse not found.
Error:(13) error: resource android:attr/textColorLinkInverse not found.
Error:resource android:style/TextAppearance.Material.Large.Inverse not found.
Error:resource android:style/TextAppearance.Material.Widget.PopupMenu.Large not found.
Error:resource android:style/TextAppearance.Material.Widget.PopupMenu.Small not found.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 10s
Information:25 errors
Information:0 warnings
Information:See complete output in console
Run Code Online (Sandbox Code Playgroud)
编辑 我修改了我的gradle:app以匹配来自ישואוהבאותך的骨架项目.除了上面提到的尝试之外,我确实必须更改compileSdkVersion,targetSdkVersion和androidTestImplementation.文件现在看起来像这样:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
defaultConfig {
applicationId "dj.kai.test_api10"
minSdkVersion 10
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
// this is the last support test for api >= 9
androidTestImplementation 'com.android.support.test:runner:1.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.0'
}
Run Code Online (Sandbox Code Playgroud)
您可以为API> = 9创建Android项目,制作项目没有技术限制.唯一的问题是Google不支持API <14以下的旧手机.从26开始的Google支持库不支持api <14.因此,您需要使用支持库25.您还需要使用允许API的支持测试版本10.
我已经为你创建了一个骨架项目.您可以访问https://github.com/isnotmenow/AndroidProjectForAPI9
阅读支持API 9的支持测试库:https: //developer.android.com/topic/libraries/testing-support-library/release-notes.html#espresso_300_runner_100_rules_100_androidtestorchestrator_100_2017-07-25_announcement
| 归档时间: |
|
| 查看次数: |
1313 次 |
| 最近记录: |