- Home /
NotFoundException: File res/mipmap-xhdpi-v4/ic_launcher.png from xml type layout resource
I use Unity call UnityPlayerActivity. In UnityPlayerActivity onCreate method .I use the flollowing code to add a view : LayoutInflater inflater = LayoutInflater.from(currentActivity); View adLayout = inflater.inflate(R.layout.banneradlayout, null); ImageAdBannerView adView = (ImageAdBannerView)adLayout.findViewById(R.id.banner);
when the app runing ,it shows the following errors: 01-08 11:00:56.619: E/AndroidRuntime(23532): FATAL EXCEPTION: main 01-08 11:00:56.619: E/AndroidRuntime(23532): java.lang.Error: FATAL EXCEPTION [main] 01-08 11:00:56.619: E/AndroidRuntime(23532): Unity version : 5.3.0f4 01-08 11:00:56.619: E/AndroidRuntime(23532): Device model : samsung SM-G7108V 01-08 11:00:56.619: E/AndroidRuntime(23532): Device fingerprint: samsung/ms01ltezm/ms01lte:4.3/JLS36C/G7108VZMUANK2:user/release-keys 01-08 11:00:56.619: E/AndroidRuntime(23532): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcoachs.unitysdkandroidproj/com.appcoachs.unitysdkandroidproj.Main2Activity}: android.content.res.Resources$NotFoundException: File res/mipmap-xhdpi-v4/ic_launcher.png from xml type layout resource ID #0x7f030000 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2362) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.app.ActivityThread.access$700(ActivityThread.java:168) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1329) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.os.Handler.dispatchMessage(Handler.java:99) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.os.Looper.loop(Looper.java:176) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.app.ActivityThread.main(ActivityThread.java:5493) 01-08 11:00:56.619: E/AndroidRuntime(23532): at java.lang.reflect.Method.invokeNative(Native Method) 01-08 11:00:56.619: E/AndroidRuntime(23532): at java.lang.reflect.Method.invoke(Method.java:525) 01-08 11:00:56.619: E/AndroidRuntime(23532): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1225) 01-08 11:00:56.619: E/AndroidRuntime(23532): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1041) 01-08 11:00:56.619: E/AndroidRuntime(23532): at dalvik.system.NativeStart.main(Native Method) 01-08 11:00:56.619: E/AndroidRuntime(23532): Caused by: android.content.res.Resources$NotFoundException: File res/mipmap-xhdpi-v4/ic_launcher.png from xml type layout resource ID #0x7f030000 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.content.res.Resources.loadXmlResourceParser(Resources.java:3242) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.content.res.Resources.loadXmlResourceParser(Resources.java:3189) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.content.res.Resources.getLayout(Resources.java:1797) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.view.LayoutInflater.inflate(LayoutInflater.java:424) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.view.LayoutInflater.inflate(LayoutInflater.java:382) 01-08 11:00:56.619: E/AndroidRuntime(23532): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.app.Activity.setContentView(Activity.java:1956) 01-08 11:00:56.619: E/AndroidRuntime(23532): at com.appcoachs.unitysdkandroidproj.Main2Activity.onCreate(Main2Activity.java:13) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.app.Activity.performCreate(Activity.java:5372) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270) 01-08 11:00:56.619: E/AndroidRuntime(23532): ... 11 more 01-08 11:00:56.619: E/AndroidRuntime(23532): Caused by: java.io.FileNotFoundException: Corrupt XML binary file 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.content.res.AssetManager.openXmlAssetNative(Native Method) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:488) 01-08 11:00:56.619: E/AndroidRuntime(23532): at android.content.res.Resources.loadXmlResourceParser(Resources.java:3220) 01-08 11:00:56.619: E/AndroidRuntime(23532): ... 21 more 01-08 11:00:56.629: I/ActivityManager(593): Notify an ApplicationCrash