From 6acd06348e9cf654c72c3afc858293cd115ada1e Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 15 Mar 2015 18:44:44 +0100 Subject: [PATCH] Better error message when starting without a binary for the current ABI --- .../src/org/ppsspp/ppsspp/PpssppActivity.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/android/src/org/ppsspp/ppsspp/PpssppActivity.java b/android/src/org/ppsspp/ppsspp/PpssppActivity.java index a50880ebca..c6664a0037 100644 --- a/android/src/org/ppsspp/ppsspp/PpssppActivity.java +++ b/android/src/org/ppsspp/ppsspp/PpssppActivity.java @@ -13,13 +13,17 @@ import com.henrikrydgard.libnative.NativeApp; public class PpssppActivity extends NativeActivity { private static boolean m_hasUnsupportedABI = false; - + private static boolean m_hasNoNativeBinary = false; static { if(Build.CPU_ABI.equals("armeabi")) { m_hasUnsupportedABI = true; } else { - System.loadLibrary("ppsspp_jni"); + try { + System.loadLibrary("ppsspp_jni"); + } catch (UnsatisfiedLinkError e) { + m_hasNoNativeBinary = true; + } } } @@ -35,14 +39,18 @@ public class PpssppActivity extends NativeActivity { @Override public void onCreate(Bundle savedInstanceState) { - if(m_hasUnsupportedABI) { + if(m_hasUnsupportedABI || m_hasNoNativeBinary) { new Thread() { @Override public void run() { Looper.prepare(); AlertDialog.Builder builder = new AlertDialog.Builder(PpssppActivity.this); - builder.setMessage(Build.CPU_ABI + " target is not supported.").setTitle("Error").create().show(); + if (m_hasUnsupportedABI) { + builder.setMessage(Build.CPU_ABI + " target is not supported.").setTitle("Error starting PPSSPP").create().show(); + } else { + builder.setMessage("The native part of PPSSPP for ABI " + Build.CPU_ABI + " is missing. Try downloading an official build?").setTitle("Error starting PPSSPP").create().show(); + } Looper.loop(); } @@ -55,7 +63,9 @@ public class PpssppActivity extends NativeActivity { } System.exit(-1); + return; } + // In case app launched from homescreen shortcut, get shortcut parameter // using Intent extra string. Intent extra will be null if launch normal // (from app drawer). @@ -123,4 +133,4 @@ public class PpssppActivity extends NativeActivity { } correctRatio(sz, (float)scale); } -} \ No newline at end of file +} \ No newline at end of file