Я работаю с командой, которая разрабатывает приложение с функцией обмена изображениями в нашем приложении.
Теперь, когда я написал эту функцию в отдельном проекте, она работала без сбоев, и я смог увидеть свое тестовое приложение в диалоговом окне общего доступа других приложений. Но когда эта функция была интегрирована кем-то в основной проект, он вообще не мог видеть приложение в диалоговом окне общего доступа. Я новичок в собственной разработке для Android, но уверен, что это связано с конфликтами в манифестах.
Проект выполняется в Unity с помощью простого jar-файла, написанного мной для обработки общих данных.
Это рабочий манифест:
<?xml version = "1.0" encoding = "utf-8"?>
<manifest xmlns:android = "http://schemas.android.com/apk/res/android" package = "com.Bigthinx.Droid" xmlns:tools = "http://schemas.android.com/tools" android:versionName = "1.0" android:versionCode = "1" android:installLocation = "preferExternal">
<supports-screens android:smallScreens = "true" android:normalScreens = "true" android:largeScreens = "true" android:xlargeScreens = "true" android:anyDensity = "true" />
<application android:theme = "@style/UnityThemeSelector" android:icon = "@drawable/app_icon" android:label = "@string/app_name" android:debuggable = "false" android:isGame = "true" android:banner = "@drawable/app_banner">
<activity android:name = "com.unity3d.player.UnityPlayerActivity" android:label = "@string/app_name" android:screenOrientation = "fullSensor" android:launchMode = "singleTask" android:configChanges = "mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density">
<intent-filter>
<action android:name = "android.intent.action.MAIN" />
<category android:name = "android.intent.category.LAUNCHER" />
<category android:name = "android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name = "android.intent.action.SEND"/>
<category android:name = "android.intent.category.DEFAULT"/>
<data android:mimeType = "text/*"/>
</intent-filter>
<intent-filter>z
<action android:name = "android.intent.action.SEND"/>
<category android:name = "android.intent.category.DEFAULT"/>
<data android:mimeType = "image/*"/>
</intent-filter>
<meta-data android:name = "unityplayer.UnityActivity" android:value = "true" />
</activity>
<meta-data android:name = "unity.build-id" android:value = "515ca393-203c-4ab0-af59-c41a3231f421" />
<meta-data android:name = "unity.splash-mode" android:value = "0" />
<meta-data android:name = "unity.splash-enable" android:value = "True" />
<meta-data android:name = "android.max_aspect" android:value = "2.1" />
</application>
<uses-sdk android:minSdkVersion = "16" android:targetSdkVersion = "28" />
<uses-feature android:glEsVersion = "0x00020000" />
<uses-feature android:name = "android.hardware.touchscreen" android:required = "false" />
<uses-feature android:name = "android.hardware.touchscreen.multitouch" android:required = "false" />
<uses-feature android:name = "android.hardware.touchscreen.multitouch.distinct" android:required = "false" />
</manifest>
И это основной манифест проекта, который не работает даже с установленными фильтрами намерения SEND:
<?xml version = "1.0" encoding = "utf-8"?>
<manifest xmlns:android = "http://schemas.android.com/apk/res/android" android:versionCode = "1" android:versionName = "1.0" package = "com.bigthinx.lyflikeandroid" android:installLocation = "preferExternal">
<supports-screens android:anyDensity = "true" android:largeScreens = "true" android:normalScreens = "true" android:smallScreens = "true" android:xlargeScreens = "true" />
<application android:icon = "@drawable/app_icon" android:label = "@string/app_name" android:debuggable = "false" android:isGame = "true" android:banner = "@drawable/app_banner" android:theme = "@style/VrActivityTheme">
<activity android:label = "@string/app_name" android:name = "com.unity3d.player.UnityPlayerActivity" android:screenOrientation = "landscape" android:launchMode = "singleTask" android:configChanges = "mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density">
<intent-filter>
<action android:name = "android.intent.action.MAIN" />
<category android:name = "android.intent.category.LAUNCHER" />
<category android:name = "android.intent.category.LEANBACK_LAUNCHER" />
<category android:name = "com.google.intent.category.CARDBOARD" />
</intent-filter>
<intent-filter>
<action android:name = "android.intent.action.SEND"/>
<category android:name = "android.intent.category.DEFAULT"/>
<data android:name = "text/*"/>
</intent-filter>
<intent-filter>
<action android:name = "android.intent.action.SEND"/>
<category android:name = "android.intent.action.DEFAULT"/>
<data android:name = "image/*"/>
</intent-filter>
<meta-data android:name = "unityplayer.UnityActivity" android:value = "true" />
</activity>
<activity android:configChanges = "orientation|screenSize|uiMode|screenLayout|smallestScreenSize" android:hardwareAccelerated = "true" android:name = "com.plakc.browser.PlakcBrowserActivity" android:windowSoftInputMode = "stateAlwaysHidden" />
<activity android:configChanges = "keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:label = "@string/app_name" android:name = "com.plakc.videoplayer.player.MyActivity" android:theme = "@android:style/Theme.NoTitleBar.Fullscreen" />
<!-- This tag is required to use Google Play Services, which the IMA SDK requires -->
<meta-data android:name = "com.google.android.gms.version" android:value = "@integer/google_play_services_version" />
<activity android:configChanges = "fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:name = "com.unity.purchasing.googleplay.PurchaseActivity" android:theme = "@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:configChanges = "fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:enableVrMode = "com.google.vr.vrcore/com.google.vr.vrcore.common.VrCoreListenerService" android:name = "com.unity.purchasing.googleplay.VRPurchaseActivity" android:theme = "@style/VrActivityTheme">
<intent-filter>
<action android:name = "com.google.vr.vrcore.ACTION_NONE" />
<category android:name = "com.google.intent.category.DAYDREAM" />
</intent-filter>
</activity>
<meta-data android:name = "unity.build-id" android:value = "cbfc80f5-baae-4ebe-b696-e499b3dfdc86" />
<meta-data android:name = "unity.splash-mode" android:value = "0" />
<meta-data android:name = "unity.splash-enable" android:value = "False" />
<meta-data android:name = "android.max_aspect" android:value = "2.1" />
<meta-data android:name = "unityplayer.SkipPermissionsDialog" android:value = "true" />
<activity android:name = "com.facebook.unity.FBUnityLoginActivity" android:configChanges = "fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme = "@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name = "com.facebook.unity.FBUnityDialogsActivity" android:configChanges = "fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme = "@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name = "com.facebook.unity.FBUnityAppLinkActivity" android:exported = "true" />
<activity android:name = "com.facebook.unity.FBUnityDeepLinkingActivity" android:exported = "true" />
<activity android:name = "com.facebook.unity.FBUnityGameRequestActivity" />
<activity android:name = "com.facebook.unity.FBUnityCreateGameGroupActivity" />
<activity android:name = "com.facebook.unity.FBUnityJoinGameGroupActivity" />
<activity android:name = "com.facebook.unity.AppInviteDialogActivity" />
<meta-data android:name = "com.facebook.sdk.ApplicationId" android:value = "fb256950351806463" />
<provider android:name = "com.facebook.FacebookContentProvider" android:authorities = "com.facebook.app.FacebookContentProvider256950351806463" android:exported = "true" />
<activity android:name = "com.facebook.CustomTabMainActivity" />
<receiver android:exported = "false" android:name = "com.facebook.CurrentAccessTokenExpirationBroadcastReceiver">
<intent-filter>
<action android:name = "com.facebook.sdk.ACTION_CURRENT_ACCESS_TOKEN_CHANGED" />
</intent-filter>
</receiver>
<!--
The initialization ContentProvider will call FacebookSdk.sdkInitialize automatically
with the application context. This config is merged in with the host app's manifest,
but there can only be one provider with the same authority activated at any given
point; so if the end user has two or more different apps that use Facebook SDK, only the
first one will be able to use the provider. To work around this problem, we use the
following placeholder in the authority to identify each host application as if it was
a completely different provider.
-->
<provider android:authorities = "${applicationId}.FacebookInitProvider" android:exported = "false" android:name = "com.facebook.internal.FacebookInitProvider" />
<!-- <provider
android:name = "com.yasirkula.unity.UnitySSContentProvider"
android:authorities = "MY_UNIQUES_AUTHORITY"
android:exported = "false"
android:grantUriPermissions = "true"
/>
-->
</application>
<uses-sdk android:minSdkVersion = "19" android:targetSdkVersion = "27" />
<uses-permission android:name = "android.permission.INTERNET" />
<uses-permission android:name = "android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name = "android.permission.ACCESS_NETWORK_STATE" />
<uses-feature android:glEsVersion = "0x00020000" />
<uses-permission android:name = "android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name = "android.hardware.camera" />
<uses-permission android:name = "android.permission.CAMERA" />
<uses-feature android:name = "android.hardware.touchscreen" android:required = "false" />
<uses-feature android:name = "android.hardware.touchscreen.multitouch" android:required = "false" />
<uses-feature android:name = "android.hardware.touchscreen.multitouch.distinct" android:required = "false" />
<uses-permission android:name = "com.android.vending.BILLING" />
<!-- Indicates use of Android's VR-mode, available only on Android N+ -->
<uses-feature android:name = "android.software.vr.mode" android:required = "false" />
<!-- Indicates use of VR features that are available only on official "VR-ready" devices -->
<uses-feature android:name = "android.software.vr.high_performance" android:required = "false" />
<uses-feature android:name = "android.hardware.camera.autofocus" android:required = "false" />
<uses-feature android:name = "android.hardware.camera.front" android:required = "false" />
</manifest>
Буду рад, если кто-нибудь сможет мне помочь и указать, что не так в основном манифесте проекта.
Спасибо!
<intent-filter>
<action android:name = "android.intent.action.SEND"/>
<category android:name = "android.intent.category.DEFAULT"/>
<data android:name = "text/*"/>
</intent-filter>
android:name из data должен быть android:mimeType
Это было правильно в первом манифесте, но не во втором.
Эй, мужик, это сработало. Спасибо! Другой разработчик неправильно скопировал фильтры намерений.
<data android: mimeType = "text / *" /> Тип MIME может ограничивать отправку изображений, можете ли вы попробовать поделиться текстом, если это возможно