Исключение Java Lang при попытке StartActivity - PullRequest
0 голосов
/ 25 апреля 2018

Я хочу импортировать файл .aar, созданный с помощью Embeddinator-4000 (Xamarin), в Android Studio.До сих пор мне удавалось импортировать его, но когда я хочу запустить, он выдает ошибку, так как не может запустить встроенную активность.В приведенном ниже коде я могу импортировать свою встроенную активность, и Android Studio распознает ее, но не может запустить.Мой код

package com.example.vtest.xamarin;

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

import md58d2c94ac98792efc1a41d27f9fca88dc.ActivityWithWebView;


public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

@Override
protected void onResume() {
    super.onResume();
    Intent intent =  new Intent(this, ActivityWithWebView.class);
    startActivity(intent);
}
}

Ошибка:

  I/MonoDroid: UNHANDLED EXCEPTION:
  I/MonoDroid: Java.Lang.Exception: Resource ID #0x7f020000
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw 
  () [0x0000c] in <1c6162c340724bedb14a531b542d3b74>:0 
           at
  Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod 
  (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference 
  type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* 
   args) [0x00089] in <8ccd3e9ca0a54e4a9eabd8d2f3341ea2>:0 
           at 
  Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod 
  (System.String encodedMember, Java.Interop.IJavaPeerable self, 
  Java.Interop.JniArgumentValue* parameters) [0x0005d] in 
  <8ccd3e9ca0a54e4a9eabd8d2f3341ea2>:0 
           at Android.App.Activity.SetContentView (System.Int32 layoutResID) 
  [0x00022] in <9f1616e34a9447d78546e51afb26d1c2>:0 
           at AndroidXamarinLib.ActivityWithWebView.OnCreate 
  (Android.OS.Bundle savedInstanceState) [0x00009] in 
  <e0c4dcbd3c9b4d99b4cd7f6d6dadcb9d>:0 
           at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ 
 (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr 
 native_savedInstanceState) [0x0000f] in 
 <9f1616e34a9447d78546e51afb26d1c2>:0 
             at (wrapper dynamic-method) System.Object:18a1dee6-f57c-490b- 
 b98d-f06496304464 (intptr,intptr,intptr)
           --- End of managed Java.Lang.Exception stack trace ---
         android.content.res.Resources$NotFoundException: Resource ID 
 #0x7f020000
             at android.content.res.Resources.getValue(Resources.java:2558)
             at 
 android.content.res.Resources.loadXmlResourceParser(Resources.java:4360)
             at android.content.res.Resources.getLayout(Resources.java:2372)
             at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
             at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
             at 

   com.android.internal.policy.PhoneWindow.setContentView
   (PhoneWindow.java:474)
             at android.app.Activity.setContentView(Activity.java:2387)
             at 

   md58d2c94ac98792efc1a41d27f9fca88dc.ActivityWithWebView.n_onCreate(Native 
 Method)
             at 

   md58d2c94ac98792efc1a41d27f9fca88dc.ActivityWithWebView.onCreate
   (ActivityWithWebView.java:29)
             at android.app.Activity.performCreate(Activity.java:6876)
             at 
   android.app.Instrumentation.callActivityOnCreate
  (Instrumentation.java:1135)
             at android.app.ActivityThread.performLaunchActivity
   (ActivityThread.java:3206)
             at android.app.ActivityThread.handleLaunchActivity
    (ActivityThread.java:3349)
             at android.app.ActivityThread.access$1100
     (ActivityThread.java:221)
             at android.app.ActivityThread$H.handleMessage
      (ActivityThread.java:1794)
             at android.os.Handler.dispatchMessage(Handler.java:102)
             at android.os.Looper.loop(Looper.java:158)
             at android.app.ActivityThread.main(ActivityThread.java:7224)
             at java.lang.reflect.Method.invoke(Native Method)
             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
            (ZygoteInit.java:1230)
             at com.android.internal.os.ZygoteInit.main
            (ZygoteInit.java:1120)
           D/AndroidRuntime: Shutting down VM
           E/AndroidRuntime: FATAL EXCEPTION: main
              Process: com.example.vitali.xamarin, PID: 21248
              java.lang.RuntimeException: Unable to start activity 
        ComponentInfo{

        com.example.vitali.xamarin
       /md58d2c94ac98792efc1a41d27f9fca88dc.ActivityWithWebView}: 
       android.content.res.Resources$NotFoundException:
        Resource ID #0x7f020000
                  at android.app.ActivityThread.performLaunchActivity
        (ActivityThread.java:3253)
                  at android.app.ActivityThread.handleLaunchActivity
        (ActivityThread.java:3349)
                  at android.app.ActivityThread.access$1100
        (ActivityThread.java:221)
                  at android.app.ActivityThread$H.handleMessage
         (ActivityThread.java:1794)
                  at android.os.Handler.dispatchMessage(Handler.java:102)
                  at android.os.Looper.loop(Looper.java:158)
                  at android.app.ActivityThread.main 
         (ActivityThread.java:7224)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at 
          com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run 
          (ZygoteInit.java:1230)
                  at com.android.internal.os.ZygoteInit.main
          (ZygoteInit.java:1120)
               Caused by: android.content.res.Resources$NotFoundException: 
          Resource ID #0x7f020000
                  at 
          android.content.res.Resources.getValue(Resources.java:2558)
                  at android.content.res.Resources.loadXmlResourceParser
          (Resources.java:4360)
                  at android.content.res.Resources.getLayout
         (Resources.java:2372)
                  at android.view.LayoutInflater.inflate
         (LayoutInflater.java:427)
                  at android.view.LayoutInflater.inflate
         (LayoutInflater.java:380)
                  at com.android.internal.policy.PhoneWindow.setContentView
        (PhoneWindow.java:474)
                  at android.app.Activity.setContentView
         (Activity.java:2387)
                  at 
      md58d2c94ac98792efc1a41d27f9fca88dc.ActivityWithWebView.n_onCreate
      (Native Method)
                  at 
       md58d2c94ac98792efc1a41d27f9fca88dc.ActivityWithWebView.onCreate
        (ActivityWithWebView.java:29)
                  at android.app.Activity.performCreate(Activity.java:6876)
                  at android.app.Instrumentation.callActivityOnCreate
        (Instrumentation.java:1135)
                  at android.app.ActivityThread.performLaunchActivity
         (ActivityThread.java:3206)
                  at android.app.ActivityThread.handleLaunchActivity
         (ActivityThread.java:3349) 
                  at android.app.ActivityThread.access$1100
         (ActivityThread.java:221) 
                  at android.app.ActivityThread$H.handleMessage
         (ActivityThread.java:1794) 
                  at android.os.Handler.dispatchMessage
         (Handler.java:102) 
                  at android.os.Looper.loop
         (Looper.java:158) 
                  at android.app.ActivityThread.main
         (ActivityThread.java:7224) 
                  at java.lang.reflect.Method.invoke
         (Native Method) 
                  at 
          com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
         (ZygoteInit.java:1230) 
                  at com.android.internal.os.ZygoteInit.main
          (ZygoteInit.java:1120) 
...