我只是在玩android studio。我制作了一个小应用程序,其中包含一些gif(位于可绘制文件夹中)和一个主题(其windowBackground位于可绘制对象中)。在预览中,一切正常。另外,如果我将其安装在手机(android 4.4)上,但一旦将其安装在更高级别的android系统上,则无法找到所有图片和主题。它给了我一个找不到的例外。我还查看了我是否有多个可绘制文件夹。但是我只有1个。可绘制的。如何解决这个问题?谢谢
Res文件夹:
Styles.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="SplashScreen" parent="android:Theme">
<item name="android:windowBackground">@drawable/loading</item>
</style>
</resources>
GifView的一部分:
<pl.droidsonroids.gif.GifImageView
android:id="@+id/imageView11"
android:layout_width="37dp"
android:layout_height="51dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/button28"
app:layout_constraintStart_toEndOf="@+id/button27"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.65"
android:src="@drawable/lion" />
build.gradle:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'key0'
keyPassword 'Smaobm29'
storeFile file('C:/Users/ruben/Desktop/Programmeren/key0.jks')
storePassword 'Smaobm29'
}
}
compileSdkVersion 28
defaultConfig {
applicationId "net.game_force.ruben.jelle_app"
minSdkVersion 18
targetSdkVersion 28
versionCode 5
versionName "1.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
debuggable false
signingConfig signingConfigs.config
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.2'
}
以及可绘制文件夹中的内容: