You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running an ejected expo project (Expokit, SDK 36).
I have managed to install the module successfully and my application appears in the list of apps to share to for the specified mime types.
Though when I click my app icon, I get the following error:
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@94102b5
V/FA: onActivityCreated
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.florianwolf.voicekeep, PID: 11585
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.florianwolf.voicekeep/host.exp.exponent.share.ShareActivity}: java.lang.ClassCastException: host.exp.exponent.MainApplication cannot be cast to com.facebook.react.ReactApplication
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 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.ClassCastException: host.exp.exponent.MainApplication cannot be cast to com.facebook.react.ReactApplication
at com.facebook.react.ReactActivityDelegate.getReactNativeHost(ReactActivityDelegate.java:61)
at com.facebook.react.ReactActivityDelegate.onCreate(ReactActivityDelegate.java:76)
at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:44)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
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 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)
// define your share project, if your main project is com.sample1, then com.sample1.share makes sense....packagehost.exp.exponent.share;
// import ReactActivityimportcom.facebook.react.ReactActivity;
publicclassShareActivityextendsReactActivity {
@OverrideprotectedStringgetMainComponentName() {
// this is the name AppRegistry will use to launch the Share Viewreturn"MyShareEx";
}
}
AndroidManifext.xml
<?xml version="1.0" encoding="utf-8"?>
<manifestpackage="host.exp.exponent"xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools">
<permissionandroid:name="com.florianwolf.voicekeep.permission.C2D_MESSAGE"android:protectionLevel="signature"/>
<!-- These are required permissions to make the app run -->
<uses-permissionandroid:name="com.florianwolf.voicekeep.permission.C2D_MESSAGE" />
<uses-permissionandroid:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permissionandroid:name="android.permission.INTERNET" />
<uses-permissionandroid:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permissionandroid:name="android.permission.WAKE_LOCK" />
<!-- ADD PERMISSIONS HERE --><!-- BEGIN OPTIONAL PERMISSIONS -->
<uses-permissionandroid:name="android.permission.MANAGE_DOCUMENTS" />
<uses-permissionandroid:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permissionandroid:name="android.permission.READ_PHONE_STATE" />
<uses-permissionandroid:name="android.permission.USE_FINGERPRINT" />
<uses-permissionandroid:name="android.permission.VIBRATE" />
<uses-permissionandroid:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permissionandroid:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<!-- These require runtime permissions on M -->
<uses-permissionandroid:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permissionandroid:name="android.permission.CAMERA" />
<uses-permissionandroid:name="android.permission.READ_CONTACTS" />
<uses-permissionandroid:name="android.permission.READ_CALENDAR" />
<uses-permissionandroid:name="android.permission.WRITE_CALENDAR" />
<uses-permissionandroid:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permissionandroid:name="android.permission.RECORD_AUDIO" />
<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permissionandroid:name="android.permission.WRITE_SETTINGS" />
<!-- END OPTIONAL PERMISSIONS --><!-- ADD TEST PERMISSIONS HERE -->
<uses-featureandroid:glEsVersion="0x00020000"android:required="false" />
<uses-featureandroid:name="android.software.leanback"android:required="false" />
<uses-featureandroid:name="android.hardware.touchscreen"android:required="false" />
<applicationandroid:name=".MainApplication"android:allowBackup="true"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:largeHeap="true"android:usesCleartextTraffic="true">
<activityandroid:name=".LauncherActivity"android:exported="true"android:launchMode="singleTask"android:theme="@android:style/Theme.Translucent.NoTitleBar">
</activity>
<activityandroid:name=".experience.ExperienceActivity"android:configChanges="keyboard|keyboardHidden|orientation|screenSize"android:theme="@style/Theme.Exponent.Light"android:windowSoftInputMode="adjustResize">
</activity>
<activityandroid:name=".MainActivity"android:launchMode="singleTask"android:configChanges="keyboard|keyboardHidden|orientation|screenSize"android:theme="@style/Theme.Exponent.Splash"android:windowSoftInputMode="adjustResize">
<intent-filter>
<dataandroid:scheme="myapp"/>
<actionandroid:name="android.intent.action.VIEW"/>
<categoryandroid:name="android.intent.category.DEFAULT"/>
<categoryandroid:name="android.intent.category.BROWSABLE"/>
</intent-filter>
<intent-filter>
<actionandroid:name="android.intent.action.MAIN"/>
<categoryandroid:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<!-- ADD DETACH APP SPECIFIC INTENT FILTERS --><!-- react-native-file-share-intent; android:documentLaunchMode="never" was added manually too underneath android:windowSoftInputMode="adjustResize". <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="audio/*" /> </intent-filter>-->
</activity>
<activityandroid:name=".experience.HomeActivity"android:label="@string/app_name"android:launchMode="singleTask"android:screenOrientation="portrait"android:theme="@style/Theme.Exponent.Light">
</activity>
<activityandroid:name=".experience.TvActivity"android:label="@string/app_name"android:theme="@style/Theme.Exponent.Light"android:screenOrientation="landscape">
<intent-filter>
<actionandroid:name="android.intent.action.MAIN" />
<categoryandroid:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<activityandroid:name="com.facebook.react.devsupport.DevSettingsActivity"/>
<!-- react-native-share-extention start -->
<activityandroid:noHistory="true"android:name=".share.ShareActivity"android:configChanges="orientation"android:label="@string/title_activity_share"android:screenOrientation="portrait"android:theme="@style/Theme.Share.Transparent" >
<intent-filter>
<actionandroid:name="android.intent.action.SEND" />
<categoryandroid:name="android.intent.category.DEFAULT" />
<dataandroid:mimeType="text/plain" />
<dataandroid:mimeType="image/*" />
</intent-filter>
</activity>
<!-- react-native-share-extention end --><!-- WHEN_PREPARING_SHELL_REMOVE_FROM_HERE --><!-- ADD DEV SETTINGS HERE --><!-- BEGIN_SDK_36 -->
<activityandroid:name="abi36_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
<!-- END_SDK_36 --><!-- BEGIN_SDK_35 -->
<activityandroid:name="abi35_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
<!-- END_SDK_35 --><!-- BEGIN_SDK_34 -->
<activityandroid:name="abi34_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
<!-- END_SDK_34 --><!-- BEGIN_SDK_33 -->
<activityandroid:name="abi33_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
<!-- END_SDK_33 --><!-- WHEN_PREPARING_SHELL_REMOVE_TO_HERE -->
<activityandroid:name="net.openid.appauth.RedirectUriReceiverActivity"tools:node="replace">
<intent-filter>
<actionandroid:name="android.intent.action.VIEW"/>
<categoryandroid:name="android.intent.category.DEFAULT"/>
<categoryandroid:name="android.intent.category.BROWSABLE"/>
<dataandroid:scheme="com.florianwolf.voicekeep"android:path="oauthredirect"/>
</intent-filter>
</activity>
<!-- START OF STRIPE SCHEMES -->
<activityandroid:exported="true"android:launchMode="singleTask"android:name="expo.modules.payments.stripe.RedirectUriReceiver"android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
<intent-filter>
<actionandroid:name="android.intent.action.VIEW" />
<categoryandroid:name="android.intent.category.DEFAULT" />
<categoryandroid:name="android.intent.category.BROWSABLE" />
<dataandroid:scheme="expo.modules.payments.stripe.4dbab755-b3c0-49b2-8789-20bdd90a1704" />
</intent-filter>
</activity>
<!-- Versioned Activity for Stripe --><!-- BEGIN_SDK_36 -->
<activityandroid:exported="true"android:launchMode="singleTask"android:name="abi36_0_0.expo.modules.payments.stripe.RedirectUriReceiver"android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
<intent-filter>
<actionandroid:name="android.intent.action.VIEW" />
<categoryandroid:name="android.intent.category.DEFAULT" />
<categoryandroid:name="android.intent.category.BROWSABLE" />
<dataandroid:scheme="abi36_0_0.expo.modules.payments.stripe" />
</intent-filter>
</activity>
<!-- END_SDK_36 --><!-- BEGIN_SDK_35 -->
<activity
android:exported="true"
android:launchMode="singleTask"
android:name="abi35_0_0.expo.modules.payments.stripe.RedirectUriReceiver"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
<intent-filter>
<actionandroid:name="android.intent.action.VIEW" />
<categoryandroid:name="android.intent.category.DEFAULT" />
<categoryandroid:name="android.intent.category.BROWSABLE" />
<dataandroid:scheme="abi35_0_0.expo.modules.payments.stripe" />
</intent-filter>
</activity>
<!-- END_SDK_35 --><!-- BEGIN_SDK_34 -->
<activityandroid:exported="true"android:launchMode="singleTask"android:name="abi34_0_0.expo.modules.payments.stripe.RedirectUriReceiver"android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
<intent-filter>
<actionandroid:name="android.intent.action.VIEW" />
<categoryandroid:name="android.intent.category.DEFAULT" />
<categoryandroid:name="android.intent.category.BROWSABLE" />
<dataandroid:scheme="abi34_0_0.expo.modules.payments.stripe" />
</intent-filter>
</activity>
<!-- END_SDK_34 --><!-- BEGIN_SDK_33 -->
<activityandroid:exported="true"android:launchMode="singleTask"android:name="abi33_0_0.expo.modules.payments.stripe.RedirectUriReceiver"android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
<intent-filter>
<actionandroid:name="android.intent.action.VIEW" />
<categoryandroid:name="android.intent.category.DEFAULT" />
<categoryandroid:name="android.intent.category.BROWSABLE" />
<dataandroid:scheme="abi33_0_0.expo.modules.payments.stripe" />
</intent-filter>
</activity>
<!-- END_SDK_33 --><!-- END OF STRIPE SCHEMES -->
<activityandroid:name=".experience.ErrorActivity"android:theme="@style/Theme.Exponent.Dark"android:screenOrientation="portrait">
</activity>
<activityandroid:name=".experience.InfoActivity"android:screenOrientation="portrait"android:theme="@style/Theme.Exponent.Light">
</activity>
<activityandroid:name="com.facebook.FacebookActivity"android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"android:label="@string/app_name"android:theme="@android:style/Theme.Translucent.NoTitleBar"tools:replace="android:theme" />
<activityandroid:name="com.facebook.ads.InterstitialAdActivity"android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"android:label="@string/app_name"android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<serviceandroid:name=".ExponentIntentService"android:exported="false" />
<!-- Analytics -->
<receiverandroid:name="host.exp.exponent.referrer.InstallReferrerReceiver"android:exported="true">
<intent-filter>
<actionandroid:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<!-- This crashes: https://code.google.com/p/analytics-issues/issues/detail?id=667 TODO: turn it back on when it's fixed <service android:name="com.google.android.gms.analytics.CampaignTrackingService" android:enabled="true" android:exported="false" />-->
<receiverandroid:name="com.google.android.gms.analytics.AnalyticsReceiver"android:enabled="true">
<intent-filter>
<actionandroid:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
</intent-filter>
</receiver>
<serviceandroid:name="com.google.android.gms.analytics.AnalyticsService"android:enabled="true"android:exported="false"/>
<!-- GCM -->
<receiverandroid:name="com.google.android.gms.gcm.GcmReceiver"android:exported="true"android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<actionandroid:name="com.google.android.c2dm.intent.RECEIVE"/>
<actionandroid:name="com.google.android.c2dm.intent.REGISTRATION"/>
<categoryandroid:name="com.florianwolf.voicekeep"/>
</intent-filter>
</receiver>
<serviceandroid:name=".gcm.ExponentGcmListenerService"android:exported="false">
<intent-filter>
<actionandroid:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
<serviceandroid:name=".gcm.ExponentInstanceIDListenerService"android:exported="false">
<intent-filter>
<actionandroid:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<serviceandroid:name=".gcm.GcmRegistrationIntentService"android:exported="false">
</service>
<!-- FCM -->
<serviceandroid:name=".fcm.ExpoFcmMessagingService">
<intent-filter>
<actionandroid:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<meta-dataandroid:name="com.google.firebase.messaging.default_notification_icon"android:resource="@drawable/shell_notification_icon" />
<meta-dataandroid:name="com.google.firebase.messaging.default_notification_color"android:resource="@color/colorAccent" />
<serviceandroid:name=".fcm.FcmRegistrationIntentService"android:exported="false">
</service>
<!-- ImagePicker native module -->
<activityandroid:name="com.theartofdev.edmodo.cropper.CropImageActivity"android:theme="@style/Base.Theme.AppCompat">
</activity>
<!-- ADD FABRIC CONFIG HERE --><!-- BEGIN FABRIC CONFIG -->
<meta-dataandroid:name="io.fabric.ApiKey"android:value="a25fafe9f9edee11a9882b32e0cd7a26df6e2c42"/>
<!-- END FABRIC CONFIG --><!-- ADD GOOGLE MAPS CONFIG HERE --><!-- BEGIN GOOGLE MAPS CONFIG -->
<meta-dataandroid:name="com.google.android.geo.API_KEY"android:value="AIzaSyDh7eDB9snEFSYtf-k0gfxA45HFoR0L--I"/>
<!-- END GOOGLE MAPS CONFIG --><!-- ADD GOOGLE MOBILE ADS CONFIG HERE --><!-- BEGIN GOOGLE MOBILE ADS CONFIG -->
<meta-dataandroid:name="com.google.android.gms.ads.APPLICATION_ID"android:value="ca-app-pub-3940256099942544~3347511713"/>
<meta-dataandroid:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT"android:value="true"/>
<!-- END GOOGLE MOBILE ADS CONFIG --><!-- ADD BRANCH CONFIG HERE --><!-- ADD FACEBOOK APP ID CONFIG HERE --><!-- ADD FACEBOOK APP DISPLAY NAME CONFIG HERE --><!-- Tags below need to be in one line with no whitespace after android:value --><!-- in order for XDL to be able to replace values in them -->
<meta-dataandroid:name="com.facebook.sdk.AutoLogAppEventsEnabled"android:value="false"/>
<meta-dataandroid:name="com.facebook.sdk.AutoInitEnabled"android:value="false"/>
<meta-dataandroid:name="com.facebook.sdk.AdvertiserIDCollectionEnabled"android:value="false"/>
<meta-dataandroid:name="standaloneStripeScheme"android:value="4dbab755-b3c0-49b2-8789-20bdd90a1704" />
</application>
</manifest>
Folder structure:
Index.js:
The problem might be related to the index.js, which was not automatically created for me after ejecting from Expo, Thus I created my own index.js in the root folder where App,js is located and inserted the following, exactly as stated in the installation instructions (note that prior to the installation of this module this index.js did not exist and the app ran fine):
//index.android.jsimportReactfrom'react'import{AppRegistry}from'react-native'importAppfrom'./app.android'importSharefrom'./share.android'AppRegistry.registerComponent('VoiceKeep',()=>App)AppRegistry.registerComponent('MyShareEx',()=>Share)// TODO: Replace MyShareEx with my extension name
The text was updated successfully, but these errors were encountered:
flo-wolf
changed the title
Expokit error after clicking on my app icon during sharing
Error after clicking on my app icon during sharing (Expokit)
Feb 24, 2020
flo-wolf
changed the title
Error after clicking on my app icon during sharing (Expokit)
Error after clicking on my app icon during sharing (Expokit, Android)
Feb 24, 2020
I am running an ejected expo project (Expokit, SDK 36).
I have managed to install the module successfully and my application appears in the list of apps to share to for the specified mime types.
Though when I click my app icon, I get the following error:
MainApplication.java:
MainActivity.java:
ShareApplication.java:
ShareActivity.java:
AndroidManifext.xml
Folder structure:
Index.js:
The problem might be related to the index.js, which was not automatically created for me after ejecting from Expo, Thus I created my own index.js in the root folder where App,js is located and inserted the following, exactly as stated in the installation instructions (note that prior to the installation of this module this index.js did not exist and the app ran fine):
The text was updated successfully, but these errors were encountered: