tag:blogger.com,1999:blog-74436977225706764882024-03-04T22:21:35.001-08:00Tony BloggerAnonymoushttp://www.blogger.com/profile/04422863558539605326noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-7443697722570676488.post-11353567480696382102013-12-04T19:52:00.000-08:002013-12-04T21:44:30.956-08:00Android APP 使用Google Map 上架後無法顯示Google Map解決方法<div dir="ltr" style="text-align: left;" trbidi="on">
如果在APP上使用Google Map功能,APP上架到Google Play後,下載APP安裝到手機上後地圖部分都會是一片空白無法顯示,那是因為在開發測試時都是使用debug keystore的SHA1向Google Map申請API_KEY,所以在開發時APP在模擬器或是手機直接連接到電腦上測試時都沒有問題,但上架後卻產生問題.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLk8BpV_s63WUb9iFE8HAfjgJVxyG9AHF-csQesSvGJCKSaozmQ292i5aljraPWLyuyXs581LVqXSLKWu71dhLDUxUtWQbmQIBb18PD5kb8tfpRduyG9JyDY6IEd_WESx4T34n1PNjvior/s1600/1.tiff" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="60" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLk8BpV_s63WUb9iFE8HAfjgJVxyG9AHF-csQesSvGJCKSaozmQ292i5aljraPWLyuyXs581LVqXSLKWu71dhLDUxUtWQbmQIBb18PD5kb8tfpRduyG9JyDY6IEd_WESx4T34n1PNjvior/s400/1.tiff" width="400" /></a></div>
<a href="http://www.blogger.com/blogger.g?blogID=7443697722570676488" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="http://www.blogger.com/blogger.g?blogID=7443697722570676488" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="http://www.blogger.com/blogger.g?blogID=7443697722570676488" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="http://www.blogger.com/blogger.g?blogID=7443697722570676488" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="http://www.blogger.com/blogger.g?blogID=7443697722570676488" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><br />
<br />
<br />
<br />
<br />
解決方法如下:<br />
1. 開啟終端器建立keystore<br />
com.tony.emotorcycle 為專案的Package Name<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHhIbg0yoLqbLKfdA1oDTMKCpM_6RIQk7NaAPCaYhXLKGnfXmeC07DONBBvEQ1hED5Y6Yw32Lbcqvi-ceR0hSCB8Vc1sMqS0W_VQlXtMwTDAG-Ihat_ao6JMzXYuay-VCcDVYuEknHpa4G/s1600/2.tiff" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="339" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHhIbg0yoLqbLKfdA1oDTMKCpM_6RIQk7NaAPCaYhXLKGnfXmeC07DONBBvEQ1hED5Y6Yw32Lbcqvi-ceR0hSCB8Vc1sMqS0W_VQlXtMwTDAG-Ihat_ao6JMzXYuay-VCcDVYuEknHpa4G/s640/2.tiff" width="640" /></a></div>
<br />
2. 產生SHA1編號<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbOjf4mJTEzt57tQikYqPONWbUnc8RR55CqA2pYIl01CYQ8j2SOYbDB-d2HBxUudAMtshqi5TIyjaWeG5ZvOiRCJC9HbS1s51TXbu7JtUKFjNf_qKHRowxdyPHrlcxPycETJt4lEl0-LWI/s1600/3.tiff" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="550" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbOjf4mJTEzt57tQikYqPONWbUnc8RR55CqA2pYIl01CYQ8j2SOYbDB-d2HBxUudAMtshqi5TIyjaWeG5ZvOiRCJC9HbS1s51TXbu7JtUKFjNf_qKHRowxdyPHrlcxPycETJt4lEl0-LWI/s640/3.tiff" width="640" /></a></div>
<br />
<br />
<br />
3. 利用我們自己產生的SHA1編號,到Google Map API申請 API_KEY<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeRdeDVyrcSpJcTz1-dwd5io8PIr8Ex9CKFeBVpNwd2CRpOpP1kx8w7fW__TcnyZnxkBEVlMVg1aEIRZXcunbPoryGpVjpwKWOJpE1LkxyDeIUJAy7UbSMbBjVV5JSXM6EFACZ5RrF_-_h/s1600/4.tiff" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="218" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeRdeDVyrcSpJcTz1-dwd5io8PIr8Ex9CKFeBVpNwd2CRpOpP1kx8w7fW__TcnyZnxkBEVlMVg1aEIRZXcunbPoryGpVjpwKWOJpE1LkxyDeIUJAy7UbSMbBjVV5JSXM6EFACZ5RrF_-_h/s640/4.tiff" width="640" /></a></div>
<br />
<br />
4.將申請到的API_KEY,輸入到專中AndroidManifest.xml檔案<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH1bAKze9BAg6mkIUxRGW8yev8TnsIugeRWgJDwkhespN25zA34RApItdpI_VWuVvUhNrQmNS8dHi-8neCARCBBqn1B_OIQhox1t86LjzF14J_CwYXvHKXLyLl_tPFsy4dQlCQ2TNTD58x/s1600/5.tiff" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="41" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH1bAKze9BAg6mkIUxRGW8yev8TnsIugeRWgJDwkhespN25zA34RApItdpI_VWuVvUhNrQmNS8dHi-8neCARCBBqn1B_OIQhox1t86LjzF14J_CwYXvHKXLyLl_tPFsy4dQlCQ2TNTD58x/s400/5.tiff" width="400" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
5.專案要Package成APK時,要選擇"Use existing keystore",Location要選擇我們步驟1所產生的keystone檔案<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUIi9kO14Njh1IA39PaUXZeWtjWEt5B_yI23eNRJZB8BB2PXkp1hnoX_3YKqwvzFmfTYraJPQnZkN1pGeaHTqIN8LBYMUkshh091XlHeRkcBZVMbFTIbafl9ThXEMeFmLs1ozk_CPTeszz/s1600/6.tiff" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUIi9kO14Njh1IA39PaUXZeWtjWEt5B_yI23eNRJZB8BB2PXkp1hnoX_3YKqwvzFmfTYraJPQnZkN1pGeaHTqIN8LBYMUkshh091XlHeRkcBZVMbFTIbafl9ThXEMeFmLs1ozk_CPTeszz/s640/6.tiff" width="640" /></a></div>
<br />
<br />
6. 產生APK檔案後,可將檔案複製到手機SD卡測試是否OK.<br />
<br />
注意:keystore檔案要備份好,以後APP版本更新時,都要使用此keystore Export成APK檔案.<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/04422863558539605326noreply@blogger.com0台灣台北市25.091075 121.5598344999999724.8609805 121.23711099999997 25.3211695 121.88255799999996