应用程序除Oreo外无法正常工作

时间:2018-10-01 12:26:40

标签: android crash version

我创建了一个可以在 Huawei Mate 10 Lite Samsung S8 Oreo版本以及在 >模拟器

但是在版本8 以下的其他手机上启动时崩溃,显示为error。这是我的manifest fileapp gradle

它在第20行显示错误,该错误是SplashActivity的setContentView。

`at incrementum.newsapp.activities.SplashScreen.onCreate(SplashScreen.java:20)`
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash_screen);
    handler();
}

帮我,我即将在Appstore上上传。

2 个答案:

答案 0 :(得分:1)

这是导致您出错的原因

  Caused by: android.content.res.Resources$NotFoundException: Resource "incrementum.newsapp:drawable/splash_screen" (7f080081) is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f080081 a=-1 r=0x7f080081}

我认为您将资源放置在drawable-v21文件夹中,因此,如果使用较低版本,则需要将可绘制对象放置在drawable文件夹中

答案 1 :(得分:0)

可能与此Resources$NotFoundException: Resource is not a Drawable (color or path)?相同,您正在尝试使用仅在Oreo中可用的功能,并且需要找到其他实现方法:Newer versions of Android Studio and only two drawable directory - drawable and drawable-v21