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

Crash - Unable to start activity ChromeTabsManagerActivity #366

Open
Abhishek2250 opened this issue Jul 6, 2022 · 4 comments
Open

Crash - Unable to start activity ChromeTabsManagerActivity #366

Abhishek2250 opened this issue Jul 6, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@Abhishek2250
Copy link

Which platform(s) does your issue occur on?

Android

Please, provide the following version numbers that your issue occurs with:

react-native-cli: 2.0.1
react-native: 0.68.1
react-native-inappbrowser-reborn: 3.6.3

Please, tell us how to recreate the issue in as much detail as possible.

Getting crash from google play. Below is the log:
FATAL EXCEPTION: Thread-4
Process: com.App_name, PID: 6968
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.App_name/com.proyecto26.inappbrowser.ChromeTabsManagerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.drawable.Drawable.isProjected()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at androidx.test.espresso.base.Interrogator.loopAndInterrogate(Interrogator.java:10)
at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:7)
at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:1)
at androidx.test.espresso.base.UiControllerImpl.loopMainThreadForAtLeast(UiControllerImpl.java:7)
at androidx.test.espresso.action.Tap$1.sendTap(Tap.java:4)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:4)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:2)
at androidx.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:21)
at androidx.test.espresso.ViewInteraction.-$$Nest$mdoPerform(Unknown Source:0)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:6)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.drawable.Drawable.isProjected()' on a null object reference
at android.graphics.drawable.LayerDrawable.isProjected(LayerDrawable.java:417)
at android.view.View.invalidateInternal(View.java:16438)
at android.view.View.invalidate(View.java:16398)
at android.view.View.setBackgroundDrawable(View.java:21584)
at com.android.internal.policy.DecorView.setWindowBackground(DecorView.java:939)
at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:2626)
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2672)
at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2071)
at android.app.ActivityTransitionState.setEnterActivityOptions(ActivityTransitionState.java:160)
at android.app.Activity.performCreate(Activity.java:7144)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:2)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
... 25 more

Note: there's already a closed issue here

Thanks!

@jdnichollsc
Copy link
Member

Thanks for taking the time to fill out this bug report!

Please refer to a repository with application where the problem is reproducible 👍

@jdnichollsc jdnichollsc added the help wanted Extra attention is needed label Jul 29, 2022
@Abhishek2250
Copy link
Author

Above crash had been reported by Google Play and they didnt provide much info. I've pasted the complete log provided by the Google Play.
Thanks

@jdnichollsc
Copy link
Member

@Abhishek2250 can you share your code (JS, AndroidManifest, etc) to be able to reproduce that error please? Are you using ProGuard? 🤔

@Abhishek2250
Copy link
Author

I'm not using ProGuard

JS code:
if (await InAppBrowser.isAvailable()) {
const result = await InAppBrowser.open(url, {
// iOS Properties
dismissButtonStyle: 'close',
preferredBarTintColor: 'red',
preferredControlTintColor: 'blue',
readerMode: false,
animated: true,
modalPresentationStyle: 'popover',
modalTransitionStyle: 'coverVertical',
modalEnabled: true,
enableBarCollapsing: false,
// Android Properties
showTitle: true,
toolbarColor: 'red',
secondaryToolbarColor: 'red',
navigationBarColor: 'black',
navigationBarDividerColor: '#96A5B9',
enableUrlBarHiding: true,
enableDefaultShare: true,
forceCloseOnRedirection: false,
// Specify full animation resource identifier(package:anim/name)
// or only resource name(in case of animation bundled with app).
animations: {
startEnter: 'slide_in_right',
startExit: 'slide_out_left',
endEnter: 'slide_in_left',
endExit: 'slide_out_right'
}
})
}

Android Manifest:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="app.project_name"
android:versionCode="1"
android:versionName="1.0"
xmlns:tools="http://schemas.android.com/tools"

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />

<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="replace" />

<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.front" android:required="false" />

<application 
	android:name="app.project_name.MainApplication" 
	android:label="@string/app_name" 
	android:icon="@mipmap/ic_launcher" 
	android:roundIcon="@mipmap/ic_launcher_round" 
	android:allowBackup="false" 
	android:theme="@style/Theme.CustomSplashScreenTheme" 
	android:usesCleartextTraffic="true" 
	android:requestLegacyExternalStorage="true" 
	android:preserveLegacyExternalStorage="true"
>

	<activity
		android:name="app.project_name.MainActivity" 
		android:label="@string/app_name" 
		android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
		android:windowSoftInputMode="adjustResize" 
		android:launchMode="singleTop" 
		android:screenOrientation="portrait"
		android:exported="true"
	>
		<intent-filter>
			<action android:name="android.intent.action.MAIN" />
			<category android:name="android.intent.category.LAUNCHER" />
		</intent-filter>

		<intent-filter>
			<action android:name="android.intent.action.VIEW" />
			<category android:name="android.intent.category.DEFAULT" />
			<category android:name="android.intent.category.BROWSABLE" />
			<data android:host="deeplink_url" android:scheme="http" />
			<data android:host="deeplink_url" android:scheme="https" />
			<data android:host="sharedData" android:scheme="project_nameapp" />
		</intent-filter>

	</activity>

	<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />

	<!-- from react native notif permissions -->
	<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name" android:value="YOUR NOTIFICATION CHANNEL NAME" />
	<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description" android:value="YOUR NOTIFICATION CHANNEL DESCRIPTION" />
	<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground" android:value="true" />
	<meta-data android:name="com.dieam.reactnativepushnotification.notification_color" android:resource="@android:color/white" />
	<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@mipmap/ic_notification" />
	<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" />
	<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" android:exported="false"/>
	<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver" android:exported="false">
		<intent-filter>
			<action android:name="android.intent.action.BOOT_COMPLETED" />
		</intent-filter>
	</receiver>
	<service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService" android:exported="false">
		<intent-filter>
			<action android:name="com.google.firebase.MESSAGING_EVENT" />
		</intent-filter>
	</service>
	<!-- </Else> -->

</application>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants