台灣最大程式設計社群網站
線上人數
852
 
會員總數:244895
討論主題:188889
歡迎您免費加入會員
討論區列表 >> Android APP 開發 >> 模擬器與實際執行
[]  
[我要回覆]
1
回應主題 加入我的關注話題 檢舉此篇討論 將提問者加入個人黑名單
模擬器與實際執行
價值 : 50 QP  點閱數:275 回應數:6

樓主

培根
門外漢
0 43
1053 136
發送站內信

各位好,我初學很多東西不太懂,想請問一個問題。
最近有找到一個範本是關於mysql連接到手機顯示的
但我在Android Studio模擬器執行是沒問題的,然而在我的手機執行卻會沒警告的閃退,我拿的是ASUS ZenFone 5Z。
我有跟別人借手機測試OPPO R17 pro,他就沒問題。
關於這個問題,我要如何解決,才能在我的手機順利執行呢??

搜尋相關Tags的文章: [ 手機實際執行閃退 ] ,
本篇文章發表於2019-06-21 10:19
別忘捐VP感謝幫助你的人 新手會員瞧一瞧
1樓
回應

kkk1
檢舉此回應
Logcat 日誌要貼上來
本篇文章回覆於2019-06-24 11:26
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
2樓
作者回應

培根
檢舉此回應
您好!~,我在想說是不是我的程式碼太舊了!
我使用pixel 2 API 29 2(aandroid 10,API 29)出現錯誤報告
我把紅字已*出來
=======================================================================

2019-06-21 16:06:59.446 13955-13955/com.example.ndr_text1 D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
2019-06-21 16:06:59.450 13955-13955/com.example.ndr_text1 D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
2019-06-21 16:06:59.451 13955-13955/com.example.ndr_text1 D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
2019-06-21 16:06:59.451 13955-13955/com.example.ndr_text1 D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
2019-06-25 08:16:42.923 13955-13955/com.example.ndr_text1 I/ample.ndr_text: Not late-enabling -Xcheck:jni (already on)
********2019-06-25 08:16:43.037 13955-13955/com.example.ndr_text1 E/ample.ndr_text: Unknown bits set in runtime_flags: 0x8000
2019-06-25 08:16:43.038 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Unexpected CPU variant for X86 using defaults: x86
2019-06-25 08:16:44.242 13955-13955/com.example.ndr_text1 W/ample.ndr_text: JNI critical lock held for 49.472ms on Thread[1,tid=13955,Runnable,Thread*=0xf0737800,peer=0x72861a60,"main"]
2019-06-25 08:16:44.304 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2019-06-25 08:16:44.306 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2019-06-25 08:16:44.462 13955-13955/com.example.ndr_text1 I/WebViewFactory: Loading com.google.android.webview version 74.0.3729.149 (code 373014918)
2019-06-25 08:16:44.466 13955-13955/com.example.ndr_text1 I/ample.ndr_text: The ClassLoaderContext is a special shared library.
2019-06-25 08:16:44.468 13955-13955/com.example.ndr_text1 I/ample.ndr_text: The ClassLoaderContext is a special shared library.
2019-06-25 08:16:44.551 13955-13955/com.example.ndr_text1 I/cr_LibraryLoader: Time to load native libraries: 42 ms (timestamps 5408-5450)
2019-06-25 08:16:44.588 13955-13955/com.example.ndr_text1 I/chromium: [INFO:library_loader_hooks.cc(50)] Chromium logging enabled: level = 0, default verbosity = 0
2019-06-25 08:16:44.589 13955-13955/com.example.ndr_text1 I/cr_LibraryLoader: Expected native library version number "74.0.3729.149", actual native library version number "74.0.3729.149"
2019-06-25 08:16:44.668 13955-14626/com.example.ndr_text1 W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.google.android.webview, sandboxed = true
2019-06-25 08:16:44.689 13955-14626/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/Handler;Landroid/os/UserHandle;)Z (greylist, reflection, allowed)
2019-06-25 08:16:44.713 13955-13955/com.example.ndr_text1 I/cr_BrowserStartup: Initializing chromium process, singleProcess=false
2019-06-25 08:16:45.080 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;-><init>(Landroid/content/Context;I)V (greylist, reflection, allowed)
2019-06-25 08:16:45.080 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;->logEvent(Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;)V (greylist, reflection, allowed)
2019-06-25 08:16:45.080 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionStarted(I)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed)
2019-06-25 08:16:45.080 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(II)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed)
2019-06-25 08:16:45.080 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed)
2019-06-25 08:16:45.080 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextSelection;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed)
2019-06-25 08:16:45.080 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(III)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed)
2019-06-25 08:16:45.080 13955-13955/com.example.ndr_text1 W/ample.ndr_text: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(IIILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed)
2019-06-25 08:16:45.153 13955-14662/com.example.ndr_text1 W/cr_media: Requires BLUETOOTH permission
2019-06-25 08:16:45.171 13955-14657/com.example.ndr_text1 D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2019-06-25 08:16:45.196 13955-14700/com.example.ndr_text1 D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
2019-06-25 08:16:45.196 13955-14700/com.example.ndr_text1 D/EGL_emulation: eglCreateContext: 0xdd61af00: maj 3 min 0 rcv 3
2019-06-25 08:16:45.198 13955-14700/com.example.ndr_text1 D/EGL_emulation: eglMakeCurrent: 0xdd61af00: ver 3 0 (tinfo 0xdd60f9b0)
2019-06-25 08:16:45.316 13955-14700/com.example.ndr_text1 I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2019-06-25 08:16:45.318 13955-14700/com.example.ndr_text1 W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
2019-06-25 08:16:45.478 13955-14582/com.example.ndr_text1 D/OpenGLRenderer: Swap behavior 1
2019-06-25 08:16:45.508 13955-14700/com.example.ndr_text1 D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
2019-06-25 08:16:45.508 13955-14700/com.example.ndr_text1 D/EGL_emulation: eglCreateContext: 0xdd61bbc0: maj 3 min 0 rcv 3
2019-06-25 08:16:45.511 13955-14700/com.example.ndr_text1 D/EGL_emulation: eglMakeCurrent: 0xdd61bbc0: ver 3 0 (tinfo 0xdd60f9b0)
2019-06-25 08:16:45.514 13955-14582/com.example.ndr_text1 W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2019-06-25 08:16:45.514 13955-14582/com.example.ndr_text1 D/OpenGLRenderer: Swap behavior 0
2019-06-25 08:16:45.522 13955-14582/com.example.ndr_text1 D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
2019-06-25 08:16:45.523 13955-14582/com.example.ndr_text1 D/EGL_emulation: eglCreateContext: 0xdd61a240: maj 3 min 0 rcv 3
2019-06-25 08:16:45.527 13955-14582/com.example.ndr_text1 D/EGL_emulation: eglMakeCurrent: 0xdd61a240: ver 3 0 (tinfo 0xc5f52da0)
******2019-06-25 08:16:45.530 13955-14700/com.example.ndr_text1 E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
******2019-06-25 08:16:45.530 13955-14700/com.example.ndr_text1 E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
2019-06-25 08:16:45.542 13955-14700/com.example.ndr_text1 D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 0 0
2019-06-25 08:16:45.561 13955-14582/com.example.ndr_text1 W/Gralloc3: mapper 3.x is not supported
2019-06-25 08:16:45.638 13955-14582/com.example.ndr_text1 D/OpenGLRenderer: Setting buffer count to 3, min_undequeued 1, extraBuffers 0
******2019-06-25 08:16:45.704 13955-14700/com.example.ndr_text1 E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
******2019-06-25 08:16:45.704 13955-14700/com.example.ndr_text1 E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
2019-06-25 08:16:45.854 13955-14700/com.example.ndr_text1 D/eglCodecCommon: setVertexArrayObject: set vao to 2 (2) 0 0
2019-06-25 08:16:45.899 13955-14582/com.example.ndr_text1 D/EGL_emulation: eglMakeCurrent: 0xdd61a240: ver 3 0 (tinfo 0xc5f52da0)
2019-06-25 08:16:45.904 13955-14582/com.example.ndr_text1 D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
2019-06-25 08:16:46.151 13955-13955/com.example.ndr_text1 I/Choreographer: Skipped 42 frames! The application may be doing too much work on its main thread.
2019-06-25 08:16:46.180 13955-14582/com.example.ndr_text1 I/OpenGLRenderer: Davey! duration=738ms; Flags=0, IntendedVsync=8256339813895, Vsync=8257039813867, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=8257051113700, AnimationStart=8257051178210, PerformTraversalsStart=8257061803920, DrawStart=8257063621520, SyncQueued=8257064037610, SyncStart=8257065142160, IssueDrawCommandsStart=8257065180050, SwapBuffers=8257067222590, FrameCompleted=8257079667610, DequeueBufferDuration=3064000, QueueBufferDuration=4261000,
2019-06-25 08:17:00.218 13955-13955/com.example.ndr_text1 D/AndroidRuntime: Shutting down VM
******2019-06-25 08:17:00.220 13955-13955/com.example.ndr_text1 E/AndroidRuntime: FATAL EXCEPTION: main
****** Process: com.example.ndr_text1, PID: 13955
****** java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/HttpClient;
****** at com.example.ndr_text1.DBphp.DBstring(DBphp.java:53)
****** at com.example.ndr_text1.MainActivity.select(MainActivity.java:146)
****** at com.example.ndr_text1.MainActivity$6.run(MainActivity.java:139)
****** at android.os.Handler.handleCallback(Handler.java:883)
****** at android.os.Handler.dispatchMessage(Handler.java:100)
****** at android.os.Looper.loop(Looper.java:214)
****** at android.app.ActivityThread.main(ActivityThread.java:7319)
****** at java.lang.reflect.Method.invoke(Native Method)
****** at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
****** at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934)
****** Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.client.HttpClient" on path: DexPathList[[zip file ******"/data/app/com.example.ndr_text1-moxK4JX0SW3xMZ8rWxEbAA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.ndr_text1-moxK4JX0SW3xMZ8rWxEbAA==/lib/x86, /system/lib, /system/product/lib]]
****** at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
****** at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
****** at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
****** at com.example.ndr_text1.DBphp.DBstring(DBphp.java:53)&nbsp;
****** at com.example.ndr_text1.MainActivity.select(MainActivity.java:146)&nbsp;
****** at com.example.ndr_text1.MainActivity$6.run(MainActivity.java:139)&nbsp;
****** at android.os.Handler.handleCallback(Handler.java:883)&nbsp;
****** at android.os.Handler.dispatchMessage(Handler.java:100)&nbsp;
****** at android.os.Looper.loop(Looper.java:214)&nbsp;
****** at android.app.ActivityThread.main(ActivityThread.java:7319)&nbsp;
****** at java.lang.reflect.Method.invoke(Native Method)&nbsp;
****** at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)&nbsp;
****** at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934)&nbsp;
2019-06-25 08:17:00.246 13955-13955/com.example.ndr_text1 I/Process: Sending signal. PID: 13955 SIG: 9
=======================================================================


然而,如果我使用 pixel 2 API (Android 8.1.0, API 27)
一切正常
本篇文章回覆於2019-06-25 08:24
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
3樓
最有價值解答

kkk1
檢舉此回應
AndroidManifest.xml 補上

<uses-library android:name="org.apache.http.legacy" android:required="false" />

參考資料:https://stackoverflow.com/questions/50461881/java-lang-noclassdeffounderrorfailed-resolution-of-lorg-apache-http-protocolve
本篇文章回覆於2019-06-26 10:05
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
4樓
作者回應

培根
檢舉此回應
感謝您kkk1。
這段時間我有找到那篇文章,已經加上了。
但卻出現新的問題。

雖然有人說要加上 <library tools:node="removeAll" />
參考網址https://www.jianshu.com/p/08737282b305
但還是會報上面那條錯誤

因為android.enableAapt2=false好像被停止了,但我還是加看看,但仍然還是出錯。

而且我的Evend Los 跑出一堆 error 0x501 不知道有沒有影響,我也還在找方法

目前還在找解決方法,如果大大有方法希望可以告知!
本篇文章回覆於2019-06-26 11:20
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
5樓
作者回應

培根
檢舉此回應
非常感謝您的幫助 kkk1
我把您的句子加在
<application
......
<uses-library android:name="org.apache.http.legacy" android:required="false" />
/>

就可以了
不然我之前是放在外面,
也多虧官方給的參考我才明白
https://developer.android.com/guide/topics/manifest/uses-library-element.html?hl=zh-tw
本篇文章回覆於2019-06-26 13:25
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
6樓
回應

1甜妹75311
檢舉此回應
+Line:75311 甜-妹-外-約-臺-灣-喝-茶-首-選-優-質-約-妹
+Line:75311 甜-妹-外-約-臺-灣-喝-茶-首-選-優-質-約-妹
+Line:75311 甜-妹-外-約-臺-灣-喝-茶-首-選-優-質-約-妹
本篇文章回覆於2019-06-27 18:50
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
   
1

回覆
如要回應,請先登入.