PhoneGap中文网

 找回密码
 立即注册
查看: 46526|回复: 4
打印 上一主题 下一主题

启动调试app一直出不来效果,大牛帮忙解决下吧

[复制链接]

6

主题

14

帖子

92

积分

注册会员

Rank: 2

积分
92
跳转到指定楼层
楼主
发表于 2014-5-18 10:12:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
按照教程做,为什么启动调试的时候一直不出效果。大神救命啊!!!!!!!!!!!!!
MainActivity.java

  1. package com.example.hellophonegap;

  2. import android.support.v4.app.Fragment;
  3. import android.os.Bundle;
  4. import android.view.LayoutInflater;
  5. import android.view.Menu;
  6. import android.view.MenuItem;
  7. import android.view.View;
  8. import android.view.ViewGroup;
  9. import org.apache.cordova.*;

  10. public class MainActivity extends DroidGap {

  11.     @Override
  12.     public void onCreate(Bundle savedInstanceState) {
  13.         super.onCreate(savedInstanceState);
  14.         //setContentView(R.layout.activity_main);
  15.         super.loadUrl("file:///android_asset/www/index.html");
  16.     }


  17.     @Override
  18.     public boolean onCreateOptionsMenu(Menu menu) {
  19.         
  20.         // Inflate the menu; this adds items to the action bar if it is present.
  21.         getMenuInflater().inflate(R.menu.main, menu);
  22.         return true;
  23.     }

  24.     @Override
  25.     public boolean onOptionsItemSelected(MenuItem item) {
  26.         // Handle action bar item clicks here. The action bar will
  27.         // automatically handle clicks on the Home/Up button, so long
  28.         // as you specify a parent activity in AndroidManifest.xml.
  29.         int id = item.getItemId();
  30.         if (id == R.id.action_settings) {
  31.             return true;
  32.         }
  33.         return super.onOptionsItemSelected(item);
  34.     }

  35.     /**
  36.      * A placeholder fragment containing a simple view.
  37.      */
  38.     public static class PlaceholderFragment extends Fragment {

  39.         public PlaceholderFragment() {
  40.         }

  41.         @Override
  42.         public View onCreateView(LayoutInflater inflater, ViewGroup container,
  43.                 Bundle savedInstanceState) {
  44.             View rootView = inflater.inflate(R.layout.fragment_main, container, false);
  45.             return rootView;
  46.         }
  47.     }

  48. }
复制代码

AndroidManifest.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3.     package="com.example.hellophonegap"
  4.     android:versionCode="1"
  5.     android:versionName="1.0" >

  6.     <uses-sdk
  7.         android:minSdkVersion="8"
  8.         android:targetSdkVersion="19" />
  9.     <supports-screens
  10.         android:largeScreens="true"
  11.         android:normalScreens="true"
  12.         android:smallScreens="true"
  13.         android:resizeable="true"
  14.         android:anyDensity="true"
  15.     />
  16.     <uses-permission android:name="android.permission.CAMERA" />
  17.     <uses-permission android:name="android.permission.VIBRATE" />
  18.     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  19.     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  20.     <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
  21.     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  22.     <uses-permission android:name="android.permission.INTERNET" />
  23.     <uses-permission android:name="android.permission.RECEIVE_SMS" />
  24.     <uses-permission android:name="android.permission.RECORD_AUDIO" />
  25.     <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
  26.     <uses-permission android:name="android.permission.READ_CONTACTS" />
  27.     <uses-permission android:name="android.permission.WRITE_CONTACTS" />
  28.     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  29.     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  30.     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
  31.     <application
  32.         android:allowBackup="true"
  33.         android:icon="@drawable/ic_launcher"
  34.         android:label="@string/app_name"
  35.         android:theme="@style/AppTheme" >
  36.         <activity
  37.             android:name="com.example.hellophonegap.MainActivity"
  38.             android:label="@string/app_name" >
  39.             <intent-filter>
  40.                 <action android:name="android.intent.action.MAIN" />

  41.                 <category android:name="android.intent.category.LAUNCHER" />
  42.             </intent-filter>
  43.         </activity>
  44.     </application>

  45. </manifest>
复制代码

log:
  1. 05-17 21:52:04.847: W/ActivityThread(1176): Application com.example.hellophonegap is waiting for the debugger on port 8100...
  2. 05-17 21:52:04.857: I/System.out(1176): Sending WAIT chunk
  3. 05-17 21:52:04.877: I/dalvikvm(1176): Debugger is active
  4. 05-17 21:52:05.067: I/System.out(1176): Debugger has connected
  5. 05-17 21:52:05.067: I/System.out(1176): waiting for debugger to settle...
  6. 05-17 21:52:05.277: I/System.out(1176): waiting for debugger to settle...
  7. 05-17 21:52:05.477: I/System.out(1176): waiting for debugger to settle...
  8. 05-17 21:52:05.687: I/System.out(1176): waiting for debugger to settle...
  9. 05-17 21:52:05.897: I/System.out(1176): waiting for debugger to settle...
  10. 05-17 21:52:06.107: I/System.out(1176): waiting for debugger to settle...
  11. 05-17 21:52:06.307: I/System.out(1176): waiting for debugger to settle...
  12. 05-17 21:52:06.507: I/System.out(1176): waiting for debugger to settle...
  13. 05-17 21:52:06.717: I/System.out(1176): waiting for debugger to settle...
  14. 05-17 21:52:06.917: I/System.out(1176): waiting for debugger to settle...
  15. 05-17 21:52:07.127: I/System.out(1176): waiting for debugger to settle...
  16. 05-17 21:52:07.327: I/System.out(1176): waiting for debugger to settle...
  17. 05-17 21:52:07.537: I/System.out(1176): debugger has settled (1369)
  18. 05-17 21:52:08.227: I/CordovaLog(1176): Changing log level to DEBUG(3)
  19. 05-17 21:52:08.257: D/CordovaActivity(1176): CordovaActivity.onCreate()
  20. 05-17 21:52:08.437: V/WebViewChromium(1176): Binding Chromium to the background looper Looper (main, tid 1) {b3d97460}
  21. 05-17 21:52:08.467: I/chromium(1176): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
  22. 05-17 21:52:08.487: I/BrowserProcessMain(1176): Initializing chromium process, renderers=0
  23. 05-17 21:52:08.777: E/chromium(1176): [ERROR:gl_surface_egl.cc(153)] No suitable EGL configs found.
  24. 05-17 21:52:08.777: E/chromium(1176): [ERROR:gl_surface_egl.cc(620)] GLSurfaceEGL::InitializeOneOff failed.
  25. 05-17 21:52:08.787: E/chromium(1176): [ERROR:gl_surface_egl.cc(153)] No suitable EGL configs found.
  26. 05-17 21:52:08.787: E/chromium(1176): [ERROR:gl_surface_egl.cc(620)] GLSurfaceEGL::InitializeOneOff failed.
  27. 05-17 21:52:08.787: E/chromium(1176): [ERROR:gpu_info_collector.cc(86)] gfx::GLSurface::InitializeOneOff() failed
  28. 05-17 21:52:08.797: W/chromium(1176): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
  29. 05-17 21:52:09.157: D/dalvikvm(1176): GC_FOR_ALLOC freed 64K, 5% free 2949K/3092K, paused 78ms, total 86ms
  30. 05-17 21:52:09.177: I/dalvikvm-heap(1176): Grow heap (frag case) to 3.560MB for 635812-byte allocation
  31. 05-17 21:52:09.337: D/dalvikvm(1176): GC_FOR_ALLOC freed <1K, 4% free 3569K/3716K, paused 123ms, total 123ms
  32. 05-17 21:52:09.687: D/CordovaWebView(1176): CordovaWebView is running on device made by: unknown
  33. 05-17 21:52:09.767: D/JsMessageQueue(1176): Set native->JS mode to 2
  34. 05-17 21:52:09.797: D/CordovaActivity(1176): CordovaActivity.init()
  35. 05-17 21:52:09.937: D/CordovaWebView(1176): >>> loadUrl(file:///android_asset/www/index.html)
  36. 05-17 21:52:09.937: D/PluginManager(1176): init()
  37. 05-17 21:52:10.047: D/CordovaWebView(1176): >>> loadUrlNow()
  38. 05-17 21:52:10.497: D/Config(1176): Unlimited access to network resources
  39. 05-17 21:52:10.507: I/CordovaLog(1176): Found start page location: index.html
  40. 05-17 21:52:10.507: I/CordovaLog(1176): Changing log level to DEBUG(3)
  41. 05-17 21:52:10.537: D/CordovaActivity(1176): Resuming the App
  42. 05-17 21:52:10.537: D/CordovaActivity(1176): CB-3064: The errorUrl is null
  43. 05-17 21:52:10.787: D/SoftKeyboardDetect(1176): Ignore this event
  44. 05-17 21:52:11.007: I/Choreographer(1176): Skipped 67 frames!  The application may be doing too much work on its main thread.
  45. 05-17 21:52:11.057: D/gralloc_goldfish(1176): Emulator without GPU emulation detected.
  46. 05-17 21:52:11.427: I/Choreographer(1176): Skipped 36 frames!  The application may be doing too much work on its main thread.
  47. 05-17 21:52:11.457: D/SoftKeyboardDetect(1176): Ignore this event
  48. 05-17 21:52:12.337: D/CordovaActivity(1176): onMessage(onPageStarted,file:///android_asset/www/index.html)
  49. 05-17 21:52:13.797: D/CordovaLog(1176): file:///android_asset/www/index.html: Line 6 : Viewport target-densitydpi is not supported.
  50. 05-17 21:52:13.817: I/chromium(1176): [INFO:CONSOLE(6)] "Viewport target-densitydpi is not supported.", source: file:///android_asset/www/index.html (6)
  51. 05-17 21:52:14.947: E/AndroidProtocolHandler(1176): Unable to open asset URL: file:///android_asset/www/cordova_plugins.json
  52. 05-17 21:52:15.087: D/Cordova(1176): onPageFinished(file:///android_asset/www/index.html)
  53. 05-17 21:52:15.097: D/CordovaActivity(1176): onMessage(onPageFinished,file:///android_asset/www/index.html)
  54. 05-17 21:52:15.317: E/AndroidProtocolHandler(1176): Unable to open asset URL: file:///android_asset/www/cordova_plugins.js
复制代码




回复

使用道具 举报

493

主题

2035

帖子

6894

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
6894
沙发
发表于 2014-5-18 13:29:23 | 只看该作者
http://bbs.phonegap100.com/forum ... &extra=page%3D1

看看这一讲 照着来  下面有课件
回复 支持 反对

使用道具 举报

0

主题

18

帖子

50

积分

注册会员

Rank: 2

积分
50
板凳
发表于 2015-4-30 01:55:29 | 只看该作者
很不错,不错,学习学习。跨平台得顶起
回复 支持 反对

使用道具 举报

0

主题

17

帖子

55

积分

注册会员

Rank: 2

积分
55
地板
发表于 2015-4-30 15:05:28 | 只看该作者
人不错,学习学习 感觉phonegap+html越来越火了。
回复 支持 反对

使用道具 举报

0

主题

19

帖子

51

积分

注册会员

Rank: 2

积分
51
5#
发表于 2015-4-30 15:49:16 | 只看该作者
好东西啊,谢谢分享 感谢phonegap中文网
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

ionic4视频教程

Archiver|手机版|小黑屋| PhoneGap中文网 ( 京ICP备13027796号-1 )  

GMT+8, 2024-12-24 10:42 , Processed in 0.095491 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表