Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android app crashes on startup. #120

Closed
Apetrou opened this issue Jun 24, 2019 · 4 comments
Closed

Android app crashes on startup. #120

Apetrou opened this issue Jun 24, 2019 · 4 comments

Comments

@Apetrou
Copy link

Apetrou commented Jun 24, 2019

Hi,
I'm having issues with my app crashing as soon as it starts up. I get the following error trace on logcat:

06-24 21:46:15.111 6650 6650 E AndroidRuntime: FATAL EXCEPTION: main
06-24 21:46:15.111 6650 6650 E AndroidRuntime: Process: com.xxxx, PID: 6650
06-24 21:46:15.111 6650 6650 E AndroidRuntime: java.lang.Error: Unresolved compilation problems:
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The import android.app cannot be resolved
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The import com.facebook.react.ReactApplication cannot be resolved
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The import com.swmansion.gesturehandler.react.RNGestureHandlerPackage cannot be resolved
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The import com.facebook.react.ReactNativeHost cannot be resolved
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The import com.facebook.react.ReactPackage cannot be resolved
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The import com.facebook.react.shell cannot be resolved
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The import com.facebook.soloader.SoLoader cannot be resolved
06-24 21:46:15.111 6650 6650 E AndroidRuntime: Application cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: ReactApplication cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: ReactNativeHost cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: ReactNativeHost cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The method getUseDeveloperSupport() of type new ReactNativeHost(){} must override or implement a supertype method
06-24 21:46:15.111 6650 6650 E AndroidRuntime: ReactPackage cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The method getPackages() of type new ReactNativeHost(){} must override or implement a supertype method
06-24 21:46:15.111 6650 6650 E AndroidRuntime: ReactPackage cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: MainReactPackage cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: RNGestureHandlerPackage cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The method getJSMainModuleName() of type new ReactNativeHost(){} must override or implement a supertype method
06-24 21:46:15.111 6650 6650 E AndroidRuntime: ReactNativeHost cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The method getReactNativeHost() of type MainApplication must override or implement a supertype method
06-24 21:46:15.111 6650 6650 E AndroidRuntime: ReactNativeHost cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: The method onCreate() of type MainApplication must override or implement a supertype method
06-24 21:46:15.111 6650 6650 E AndroidRuntime: Application cannot be resolved to a type
06-24 21:46:15.111 6650 6650 E AndroidRuntime: SoLoader cannot be resolved
06-24 21:46:15.111 6650 6650 E AndroidRuntime:
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at com.xxxx.MainApplication.(MainApplication.java:3)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at java.lang.Class.newInstance(Native Method)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:50)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at android.app.Instrumentation.newApplication(Instrumentation.java:1120)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at android.app.LoadedApk.makeApplication(LoadedApk.java:1061)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5842)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at android.app.ActivityThread.access$1100(ActivityThread.java:199)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6669)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
06-24 21:46:15.111 6650 6650 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

I know its this package causing it as when I comment out its references the error stops. I assume what is happening is that the unity view is crashing for some reason and because the unity activity runs in parallel with the main activity it also causes that to crash producing the error of modules not being resolved. Is anyone else having or has had a similar issue and if so how did you deal with it?

Many thanks,
Alkis.

@Apetrou Apetrou closed this as completed Jun 28, 2019
@itinance
Copy link

itinance commented Nov 15, 2019

@Apetrou What was your solution?

@Apetrou
Copy link
Author

Apetrou commented Nov 19, 2019

It was due to an issue with my unity file. When I fixed the issues in the unity file and re exported it worked fine!

@itinance
Copy link

It was due to an issue with my unity file. When I fixed the issues in the unity file and re exported it worked fine!

Hey @Apetrou , thanks for reaching out! Can you please describe a bit more in detail what the issue exactly was? Code side? Plugin side? Or something different?

@itinance
Copy link

The solution for our issue is this: #142 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants