{"id":55571,"date":"2025-08-14T00:45:41","date_gmt":"2025-08-13T16:45:41","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/55571.html"},"modified":"2025-08-14T00:45:41","modified_gmt":"2025-08-13T16:45:41","slug":"xamarin-forms-%e5%8d%87%e7%ba%a7%e4%b9%8b%e6%97%85%ef%bc%9a%e8%a7%a3%e5%86%b3-android-12-%e5%85%bc%e5%ae%b9%e6%80%a7%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/55571.html","title":{"rendered":"Xamarin Forms \u5347\u7ea7\u4e4b\u65c5\uff1a\u89e3\u51b3 Android 12 \u517c\u5bb9\u6027\u95ee\u9898"},"content":{"rendered":"<p>\u5728\u4f7f\u7528 Xamarin.Forms \u8fdb\u884c Android \u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u65f6\uff0c\u5347\u7ea7\u76ee\u6807 API \u7ea7\u522b\u5230 Android 12\uff08API 31\uff09\u6216\u66f4\u9ad8\u7248\u672c\u65f6\uff0c\u5f00\u53d1\u8005\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u65b0\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002\u8fd9\u7bc7\u535a\u6587\u5c06\u901a\u8fc7\u4e00\u4e2a\u5b9e\u9645\u6848\u4f8b\uff0c\u8be6\u7ec6\u8bb2\u89e3\u5982\u4f55\u89e3\u51b3\u5728\u5347\u7ea7\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u7684 android:exported \u5c5e\u6027\u95ee\u9898\u3002<\/p>\n<h3>\u80cc\u666f<\/h3>\n<p>\u6700\u8fd1\uff0c\u6211\u5728\u5c06 Xamarin Forms \u9879\u76ee\u7684\u76ee\u6807\u7248\u672c\u4ece\u8f83\u4f4e\u7684 API \u7ea7\u522b\u5347\u7ea7\u5230 Android 12\uff08API 31\uff09\u65f6\uff0c\u9047\u5230\u4e86\u4ee5\u4e0b\u9519\u8bef\uff1a<\/p>\n<p>android:exported needs to be explicitly specified for element &lt;service#crc6494e14b9856016c30.PNFirebaseIIDService&gt;.<\/p>\n<h3>\u95ee\u9898\u5206\u6790<\/h3>\n<p>Android 12 \u5f15\u5165\u4e86\u65b0\u7684\u5b89\u5168\u6027\u8981\u6c42\uff0c\u5bf9\u4e8e\u58f0\u660e\u4e86 Intent Filter \u7684\u7ec4\u4ef6\uff08\u5982 Service, Activity \u7b49\uff09\uff0c\u5fc5\u987b\u663e\u5f0f\u6307\u5b9a android:exported \u5c5e\u6027\u3002\u8fd9\u4e2a\u5c5e\u6027\u51b3\u5b9a\u4e86\u7ec4\u4ef6\u662f\u5426\u53ef\u4ee5\u88ab\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\u8bbf\u95ee\u3002<\/p>\n<h3>\u89e3\u51b3\u65b9\u6848<\/h3>\n<h4>\u6b65\u9aa4\u4e00\uff1a\u4fee\u6539 AndroidManifest.xml<\/h4>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5728 AndroidManifest.xml \u6587\u4ef6\u4e2d\u4e3a\u76f8\u5173\u670d\u52a1\u6dfb\u52a0 android:ex<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb52\u6b21\u3002\u6458\u8981\uff1a\u672c\u6587\u4ecb\u7ecd\u4e86\u5728\u5c06Xamarin.Forms\u9879\u76ee\u5347\u7ea7\u81f3Android 12\uff08API 31\uff09\u65f6\u9047\u5230\u7684android:exported\u5c5e\u6027\u95ee\u9898\u3002\u9488\u5bf9\u62a5\u9519\u63d0\u793a\uff0c\u4f5c\u8005\u901a\u8fc7\u4fee\u6539AndroidManifest.xml\u6587\u4ef6\u663e\u5f0f\u58f0\u660e\u5c5e\u6027\uff0c\u5e76\u53d1\u73b0\u9519\u8bef\u6e90\u4e8e\u7b2c\u4e09\u65b9NuGet\u5305Plugin.FirebasePushNotification\u3002\u6700\u7ec8\u901a\u8fc7\u79fb\u9664\u8be5\u5305\u5e76\u6e05\u7406\u9879\u76ee\u89e3\u51b3\u4e86\u95ee\u9898\u3002\u6587\u7ae0\u603b\u7ed3\u4e86\u5347\u7ea7Android 12\u65f6\u5fc5\u987b\u663e\u5f0f\u58f0\u660e\u7ec4\u4ef6\u5bfc\u51fa\u5c5e\u6027\u3001\u68c0\u67e5\u7b2c\u4e09\u65b9\u5e93\u4f9d\u8d56\u4ee5\u53ca\u6267\u884c\u6e05\u7406\u91cd\u5efa\u7b49\u5173\u952e\u6ce8\u610f\u4e8b\u9879\uff0c\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u5b9e\u7528\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[84,5725,569,5117],"topic":[],"class_list":["post-55571","post","type-post","status-publish","format-standard","hentry","category-server","tag-android","tag-xamarin","tag-569","tag-5117"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Xamarin Forms \u5347\u7ea7\u4e4b\u65c5\uff1a\u89e3\u51b3 Android 12 \u517c\u5bb9\u6027\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/55571.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Xamarin Forms \u5347\u7ea7\u4e4b\u65c5\uff1a\u89e3\u51b3 Android 12 \u517c\u5bb9\u6027\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb52\u6b21\u3002\u6458\u8981\uff1a\u672c\u6587\u4ecb\u7ecd\u4e86\u5728\u5c06Xamarin.Forms\u9879\u76ee\u5347\u7ea7\u81f3Android 12\uff08API 31\uff09\u65f6\u9047\u5230\u7684android:exported\u5c5e\u6027\u95ee\u9898\u3002\u9488\u5bf9\u62a5\u9519\u63d0\u793a\uff0c\u4f5c\u8005\u901a\u8fc7\u4fee\u6539AndroidManifest.xml\u6587\u4ef6\u663e\u5f0f\u58f0\u660e\u5c5e\u6027\uff0c\u5e76\u53d1\u73b0\u9519\u8bef\u6e90\u4e8e\u7b2c\u4e09\u65b9NuGet\u5305Plugin.FirebasePushNotification\u3002\u6700\u7ec8\u901a\u8fc7\u79fb\u9664\u8be5\u5305\u5e76\u6e05\u7406\u9879\u76ee\u89e3\u51b3\u4e86\u95ee\u9898\u3002\u6587\u7ae0\u603b\u7ed3\u4e86\u5347\u7ea7Android 12\u65f6\u5fc5\u987b\u663e\u5f0f\u58f0\u660e\u7ec4\u4ef6\u5bfc\u51fa\u5c5e\u6027\u3001\u68c0\u67e5\u7b2c\u4e09\u65b9\u5e93\u4f9d\u8d56\u4ee5\u53ca\u6267\u884c\u6e05\u7406\u91cd\u5efa\u7b49\u5173\u952e\u6ce8\u610f\u4e8b\u9879\uff0c\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u5b9e\u7528\u7684\u89e3\u51b3\u65b9\u6848\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/55571.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T16:45:41+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/55571.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/55571.html\",\"name\":\"Xamarin Forms \u5347\u7ea7\u4e4b\u65c5\uff1a\u89e3\u51b3 Android 12 \u517c\u5bb9\u6027\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-13T16:45:41+00:00\",\"dateModified\":\"2025-08-13T16:45:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/55571.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/55571.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/55571.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Xamarin Forms \u5347\u7ea7\u4e4b\u65c5\uff1a\u89e3\u51b3 Android 12 \u517c\u5bb9\u6027\u95ee\u9898\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Xamarin Forms \u5347\u7ea7\u4e4b\u65c5\uff1a\u89e3\u51b3 Android 12 \u517c\u5bb9\u6027\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/55571.html","og_locale":"zh_CN","og_type":"article","og_title":"Xamarin Forms \u5347\u7ea7\u4e4b\u65c5\uff1a\u89e3\u51b3 Android 12 \u517c\u5bb9\u6027\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb52\u6b21\u3002\u6458\u8981\uff1a\u672c\u6587\u4ecb\u7ecd\u4e86\u5728\u5c06Xamarin.Forms\u9879\u76ee\u5347\u7ea7\u81f3Android 12\uff08API 31\uff09\u65f6\u9047\u5230\u7684android:exported\u5c5e\u6027\u95ee\u9898\u3002\u9488\u5bf9\u62a5\u9519\u63d0\u793a\uff0c\u4f5c\u8005\u901a\u8fc7\u4fee\u6539AndroidManifest.xml\u6587\u4ef6\u663e\u5f0f\u58f0\u660e\u5c5e\u6027\uff0c\u5e76\u53d1\u73b0\u9519\u8bef\u6e90\u4e8e\u7b2c\u4e09\u65b9NuGet\u5305Plugin.FirebasePushNotification\u3002\u6700\u7ec8\u901a\u8fc7\u79fb\u9664\u8be5\u5305\u5e76\u6e05\u7406\u9879\u76ee\u89e3\u51b3\u4e86\u95ee\u9898\u3002\u6587\u7ae0\u603b\u7ed3\u4e86\u5347\u7ea7Android 12\u65f6\u5fc5\u987b\u663e\u5f0f\u58f0\u660e\u7ec4\u4ef6\u5bfc\u51fa\u5c5e\u6027\u3001\u68c0\u67e5\u7b2c\u4e09\u65b9\u5e93\u4f9d\u8d56\u4ee5\u53ca\u6267\u884c\u6e05\u7406\u91cd\u5efa\u7b49\u5173\u952e\u6ce8\u610f\u4e8b\u9879\uff0c\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u5b9e\u7528\u7684\u89e3\u51b3\u65b9\u6848\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/55571.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-13T16:45:41+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/55571.html","url":"https:\/\/www.wsisp.com\/helps\/55571.html","name":"Xamarin Forms \u5347\u7ea7\u4e4b\u65c5\uff1a\u89e3\u51b3 Android 12 \u517c\u5bb9\u6027\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-13T16:45:41+00:00","dateModified":"2025-08-13T16:45:41+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/55571.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/55571.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/55571.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Xamarin Forms \u5347\u7ea7\u4e4b\u65c5\uff1a\u89e3\u51b3 Android 12 \u517c\u5bb9\u6027\u95ee\u9898"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/55571","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=55571"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/55571\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=55571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=55571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=55571"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=55571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}