gpt4 book ai didi

android-studio-2.2 - 不幸的是,更新到Android Studio 2.2.3之后,我所有的应用程序都崩溃了

转载 作者:行者123 更新时间:2023-12-03 17:11:30 24 4
gpt4 key购买 nike

更新Android Studio 2.2.3之后,我尝试运行的小应用程序在即时运行时一直崩溃。我正在Tecno P5 android 4.2.2版上测试该应用程序

我一直在尝试简单的应用程序,但没有成功。通过这个,我正在尝试一个简单的启动屏幕。
这是logcat:

> E/VdcInflateDelegate: Exception while inflating <vector>
> org.xmlpull.v1.XmlPullParserException: Binary XML file line
> #17<vector> tag requires viewportHeight > 0
> at
> android.support.graphics.drawable.VectorDrawableCompat.updateStateFromTypedArray(VectorDrawableCompat.java:723)
> at
> android.support.graphics.drawable.VectorDrawableCompat.inflate(VectorDrawableCompat.java:653)
> at
> android.support.graphics.drawable.VectorDrawableCompat.createFromXmlInner(VectorDrawableCompat.java:615)
> at
> android.support.v7.widget.AppCompatDrawableManager$VdcInflateDelegate.createFromXmlInner(AppCompatDrawableManager.java:734)
> at
> android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:367)
> at
> android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197)
> at
> android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
> at
> android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:711)
> at
> android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:195)
> at
> android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:81)
> at
> android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:131)
> at
> android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:151)
> at
> android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:31)
> at
> android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:55)
> at
> android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:205)
> at
> android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185)
> at
> android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:525)
> at
> android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:74)
> at com.example.davy.splash.MainActivity.onCreate(MainActivity.java:13)
> at android.app.Activity.performCreate(Activity.java:5122)
> at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
> at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
> at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395)
> at android.app.ActivityThread.access$600(ActivityThread.java:162)
> at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
> at android.os.Handler.dispatchMessage(Handler.java:107)
> at android.os.Looper.loop(Looper.java:194)
> at android.app.ActivityThread.main(ActivityThread.java:5371)
> at java.lang.reflect.Method.invokeNative(Native Method)
> at java.lang.reflect.Method.invoke(Method.java:525)
> at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
> at dalvik.system.NativeStart.main(Native Method) 02-23 23:27:05.179
> 4316-4316/com.example.davy.splash E/AndroidRuntime: FATAL EXCEPTION:
> main
> java.lang.RuntimeException: Unable to start activity
> ComponentInfo{com.example.davy.splash/com.example.davy.splash.MainActivity}:
> android.content.res.Resources$NotFoundException: File
> res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020052
> at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343)
> at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395)
> at android.app.ActivityThread.access$600(ActivityThread.java:162)
> at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
> at android.os.Handler.dispatchMessage(Handler.java:107)
> at android.os.Looper.loop(Looper.java:194)
> at android.app.ActivityThread.main(ActivityThread.java:5371)
> at java.lang.reflect.Method.invokeNative(Native Method)
> at java.lang.reflect.Method.invoke(Method.java:525)
> at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
> at dalvik.system.NativeStart.main(Native Method)
> Caused by: android.content.res.Resources$NotFoundException: File
> res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020052
> at android.content.res.Resources.loadDrawable(Resources.java:1993)
> at android.content.res.Resources.getDrawable(Resources.java:673)
> at
> android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374)
> at
> android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:202)
> at
> android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
> at
> android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:711)
> at
> android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:195)
> at
> android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:81)
> at
> android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:131)
> at
> android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:151)
> at
> android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:31)
> at
> android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:55)
> at
> android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:205)
> at
> android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185)
> at
> android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:525)
> at
> android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:74)
> at com.example.davy.splash.MainActivity.onCreate(MainActivity.java:13)
> at android.app.Activity.performCreate(Activity.java:5122)
> at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
> at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
> at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395) 
> at android.app.ActivityThread.access$600(ActivityThread.java:162) 
> at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) 
> at android.os.Handler.dispatchMessage(Handler.java:107) 
> at android.os.Looper.loop(Looper.java:194) 
> at android.app.ActivityThread.main(ActivityThread.java:5371) 
> at java.lang.reflect.Method.invokeNative(Native Method) 
> at java.lang.reflect.Method.invoke(Method.java:525) 
> at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) 
> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) 
> at dalvik.system.NativeStart.main(Native Method) 
> Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line
> #17: invalid drawable tag vector
> at
> android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:881)
> at android.graphics.drawable.Drawable.createFromXml(Drawable.java:822)
> at android.content.res.Resources.loadDrawable(Resources.java:1990)
> at android.content.res.Resources.getDrawable(Resources.java:673) 
> at
> android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374) 
> at
> android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:202) 
> at
> android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190) 
> at
> android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:711) 
> at
> android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:195) 
> at
> android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:81) 
> at
> android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:131) 
> at
> android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:151) 
> at
> android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:31) 
> at
> android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:55) 
> at
> android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:205) 
> at
> android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185) 
> at
> android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:525) 
> at
> android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:74) 
> at
> com.example.davy.splash.MainActivity.onCreate(MainActivity.java:13) 
> at android.app.Activity.performCreate(Activity.java:5122) 
> at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081) 
> at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307) 
> at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395) 
> at android.app.ActivityThread.access$600(ActivityThread.java:162) 
> at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) 
> at android.os.Handler.dispatchMessage(Handler.java:107) 
> at android.os.Looper.loop(Looper.java:194) 
> at android.app.ActivityThread.main(ActivityThread.java:5371) 
> at java.lang.reflect.Method.invokeNative(Native Method) 
> at java.lang.reflect.Method.invoke(Method.java:525)

我的主要 Activity :
package com.example.davy.splash;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
private static int SPLASH_TIME_OUT = 4000;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent homeIntent = new Intent(MainActivity.this,Home.class);
startActivity(homeIntent);
finish();
}
},SPLASH_TIME_OUT);
}
}

最佳答案

在我将V2更改为V1签名之前,我会经历同样的事情。所有应用在Android 4.x设备(SDK API 19)中崩溃。检查您是否正在尝试使用签名版本2或版本1生成签名的APK。APK签名方案v2定位于Android 7.0(API级别24)。如果您将Android 4.x定位为V1 Signature for earlier Android 4-6,请使用版本1

关于android-studio-2.2 - 不幸的是,更新到Android Studio 2.2.3之后,我所有的应用程序都崩溃了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42425572/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com