Posts

Showing posts from September, 2013

การหาค่า Key Hashes ปัญหา keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary| openssl base64 'openssl' is not recognized as an internal or external command,

Image
         ตอนนี้ผมอยากเขียน App Android เชื่อมต่อกับ Facebook แต่ปัญหาที่พบเจอคือ เมื่อใช้คำสั่ง  keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64  เพื่อที่จะหา Key Hashes มาใช้ ใส่ในการ Create App Facebook  ดันฟ้อง error มาล้านแปด 555 ประมาณนี้ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary| openssl base64 'openssl' is not recognized as an internal or external command,  เลยลองหาวิธีแก้ไป นั่งงมๆหาอยู่หลายนาทีจนได้วิธีได้ค่า Key Hashes  ออกมา มาดูกันเลยครับต้องทำยังไง 1. Download openssl-for-windows มาติดตั้ง ถ้าเครื่องของคุณเป็น 64Bit โหลด ถ้าเครื่องของคุณเป็น 32Bit โหลด 2. ทำการแตกไฟล์ Zip ลงเครื่อง ผมขออ้างอิงไดเรกเทอรี่ C:\openssl-0.9.8k_X64 เพื่อให้ง่าย (เครื่องผม 64bit) 3. ทำการ Add Environment Variables... โดยคลิกขวาที่ MyComputer เลือก Properties Value ให้ใส่ ; ไดเรกเทอรี่\ bin ของผมเป็น 64bit คือ ;C:\openssl-0.9.8k_X64\bi