|
按照教程做,为什么启动调试的时候一直不出效果。大神救命啊!!!!!!!!!!!!!
MainActivity.java
- package com.example.hellophonegap;
- import android.support.v4.app.Fragment;
- import android.os.Bundle;
- import android.view.LayoutInflater;
- import android.view.Menu;
- import android.view.MenuItem;
- import android.view.View;
- import android.view.ViewGroup;
- import org.apache.cordova.*;
- public class MainActivity extends DroidGap {
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- //setContentView(R.layout.activity_main);
- super.loadUrl("file:///android_asset/www/index.html");
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
-
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.main, menu);
- return true;
- }
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Handle action bar item clicks here. The action bar will
- // automatically handle clicks on the Home/Up button, so long
- // as you specify a parent activity in AndroidManifest.xml.
- int id = item.getItemId();
- if (id == R.id.action_settings) {
- return true;
- }
- return super.onOptionsItemSelected(item);
- }
- /**
- * A placeholder fragment containing a simple view.
- */
- public static class PlaceholderFragment extends Fragment {
- public PlaceholderFragment() {
- }
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View rootView = inflater.inflate(R.layout.fragment_main, container, false);
- return rootView;
- }
- }
- }
复制代码
AndroidManifest.xml
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.hellophonegap"
- android:versionCode="1"
- android:versionName="1.0" >
- <uses-sdk
- android:minSdkVersion="8"
- android:targetSdkVersion="19" />
- <supports-screens
- android:largeScreens="true"
- android:normalScreens="true"
- android:smallScreens="true"
- android:resizeable="true"
- android:anyDensity="true"
- />
- <uses-permission android:name="android.permission.CAMERA" />
- <uses-permission android:name="android.permission.VIBRATE" />
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
- <uses-permission android:name="android.permission.READ_PHONE_STATE" />
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.RECEIVE_SMS" />
- <uses-permission android:name="android.permission.RECORD_AUDIO" />
- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
- <uses-permission android:name="android.permission.READ_CONTACTS" />
- <uses-permission android:name="android.permission.WRITE_CONTACTS" />
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
- <uses-permission android:name="android.permission.GET_ACCOUNTS" />
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.example.hellophonegap.MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
- </manifest>
复制代码
log:
- 05-17 21:52:04.847: W/ActivityThread(1176): Application com.example.hellophonegap is waiting for the debugger on port 8100...
- 05-17 21:52:04.857: I/System.out(1176): Sending WAIT chunk
- 05-17 21:52:04.877: I/dalvikvm(1176): Debugger is active
- 05-17 21:52:05.067: I/System.out(1176): Debugger has connected
- 05-17 21:52:05.067: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:05.277: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:05.477: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:05.687: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:05.897: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:06.107: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:06.307: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:06.507: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:06.717: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:06.917: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:07.127: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:07.327: I/System.out(1176): waiting for debugger to settle...
- 05-17 21:52:07.537: I/System.out(1176): debugger has settled (1369)
- 05-17 21:52:08.227: I/CordovaLog(1176): Changing log level to DEBUG(3)
- 05-17 21:52:08.257: D/CordovaActivity(1176): CordovaActivity.onCreate()
- 05-17 21:52:08.437: V/WebViewChromium(1176): Binding Chromium to the background looper Looper (main, tid 1) {b3d97460}
- 05-17 21:52:08.467: I/chromium(1176): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
- 05-17 21:52:08.487: I/BrowserProcessMain(1176): Initializing chromium process, renderers=0
- 05-17 21:52:08.777: E/chromium(1176): [ERROR:gl_surface_egl.cc(153)] No suitable EGL configs found.
- 05-17 21:52:08.777: E/chromium(1176): [ERROR:gl_surface_egl.cc(620)] GLSurfaceEGL::InitializeOneOff failed.
- 05-17 21:52:08.787: E/chromium(1176): [ERROR:gl_surface_egl.cc(153)] No suitable EGL configs found.
- 05-17 21:52:08.787: E/chromium(1176): [ERROR:gl_surface_egl.cc(620)] GLSurfaceEGL::InitializeOneOff failed.
- 05-17 21:52:08.787: E/chromium(1176): [ERROR:gpu_info_collector.cc(86)] gfx::GLSurface::InitializeOneOff() failed
- 05-17 21:52:08.797: W/chromium(1176): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
- 05-17 21:52:09.157: D/dalvikvm(1176): GC_FOR_ALLOC freed 64K, 5% free 2949K/3092K, paused 78ms, total 86ms
- 05-17 21:52:09.177: I/dalvikvm-heap(1176): Grow heap (frag case) to 3.560MB for 635812-byte allocation
- 05-17 21:52:09.337: D/dalvikvm(1176): GC_FOR_ALLOC freed <1K, 4% free 3569K/3716K, paused 123ms, total 123ms
- 05-17 21:52:09.687: D/CordovaWebView(1176): CordovaWebView is running on device made by: unknown
- 05-17 21:52:09.767: D/JsMessageQueue(1176): Set native->JS mode to 2
- 05-17 21:52:09.797: D/CordovaActivity(1176): CordovaActivity.init()
- 05-17 21:52:09.937: D/CordovaWebView(1176): >>> loadUrl(file:///android_asset/www/index.html)
- 05-17 21:52:09.937: D/PluginManager(1176): init()
- 05-17 21:52:10.047: D/CordovaWebView(1176): >>> loadUrlNow()
- 05-17 21:52:10.497: D/Config(1176): Unlimited access to network resources
- 05-17 21:52:10.507: I/CordovaLog(1176): Found start page location: index.html
- 05-17 21:52:10.507: I/CordovaLog(1176): Changing log level to DEBUG(3)
- 05-17 21:52:10.537: D/CordovaActivity(1176): Resuming the App
- 05-17 21:52:10.537: D/CordovaActivity(1176): CB-3064: The errorUrl is null
- 05-17 21:52:10.787: D/SoftKeyboardDetect(1176): Ignore this event
- 05-17 21:52:11.007: I/Choreographer(1176): Skipped 67 frames! The application may be doing too much work on its main thread.
- 05-17 21:52:11.057: D/gralloc_goldfish(1176): Emulator without GPU emulation detected.
- 05-17 21:52:11.427: I/Choreographer(1176): Skipped 36 frames! The application may be doing too much work on its main thread.
- 05-17 21:52:11.457: D/SoftKeyboardDetect(1176): Ignore this event
- 05-17 21:52:12.337: D/CordovaActivity(1176): onMessage(onPageStarted,file:///android_asset/www/index.html)
- 05-17 21:52:13.797: D/CordovaLog(1176): file:///android_asset/www/index.html: Line 6 : Viewport target-densitydpi is not supported.
- 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)
- 05-17 21:52:14.947: E/AndroidProtocolHandler(1176): Unable to open asset URL: file:///android_asset/www/cordova_plugins.json
- 05-17 21:52:15.087: D/Cordova(1176): onPageFinished(file:///android_asset/www/index.html)
- 05-17 21:52:15.097: D/CordovaActivity(1176): onMessage(onPageFinished,file:///android_asset/www/index.html)
- 05-17 21:52:15.317: E/AndroidProtocolHandler(1176): Unable to open asset URL: file:///android_asset/www/cordova_plugins.js
复制代码
|
|