android+phonegap问题

番茄很忙 2014-05-07 05:35:40
今天使用android+phonegap搭建环境,搞了一下午,都没弄出来,是根据http://www.phonegapcn.com/developers/get-started-13/get-started 这个教程来搭建的,真是郁闷死了?哪位牛人给点指点,本人没第一次搭建android平台
项目结构:


package firstPhoneGap;

import android.os.Bundle;

import com.phonegap.DroidGap;

public class App extends DroidGap{
@Override
public void onCreate(Bundle b){
super.onCreate(b);
super.loadUrl("file:///android_asset/www/index.html");
}

}


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>test</title>
<script type="text/javascript" src="phonegap-1.0.0.js"></script>
</head>
<body>
hello phoneGap!
</body>
</html>


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.firstphonegap"
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=".test"
android:label="@string/app_name"
android:configChanges="orientation">
<intent-filter >
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.phonegap.DroidGap" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden">
<intent-filter> </intent-filter>
</activity>
</application>
</manifest>


控制台信息:
[2014-05-07 16:39:21 - firstPhoneGap] ------------------------------
[2014-05-07 16:39:21 - firstPhoneGap] Android Launch!
[2014-05-07 16:39:21 - firstPhoneGap] adb is running normally.
[2014-05-07 16:39:21 - firstPhoneGap] Performing com.example.firstphonegap.test activity launch
[2014-05-07 16:39:21 - firstPhoneGap] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2014-05-07 16:39:24 - firstPhoneGap] Launching a new emulator with Virtual Device 'phoneGapAvd'
[2014-05-07 16:39:43 - firstPhoneGap] New emulator found: emulator-5554
[2014-05-07 16:39:43 - firstPhoneGap] Waiting for HOME ('android.process.acore') to be launched...
[2014-05-07 16:40:16 - firstPhoneGap] emulator-5554 disconnected! Cancelling 'com.example.firstphonegap.test activity launch'!
[2014-05-07 16:44:28 - firstPhoneGap] ------------------------------
[2014-05-07 16:44:28 - firstPhoneGap] Android Launch!
[2014-05-07 16:44:28 - firstPhoneGap] adb is running normally.
[2014-05-07 16:44:28 - firstPhoneGap] Performing com.example.firstphonegap.test activity launch
[2014-05-07 16:44:28 - firstPhoneGap] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2014-05-07 16:44:31 - firstPhoneGap] Launching a new emulator with Virtual Device 'phoneGapAvd'
[2014-05-07 16:44:49 - firstPhoneGap] New emulator found: emulator-5554
[2014-05-07 16:44:49 - firstPhoneGap] Waiting for HOME ('android.process.acore') to be launched...
[2014-05-07 16:45:16 - firstPhoneGap] emulator-5554 disconnected! Cancelling 'com.example.firstphonegap.test activity launch'!
[2014-05-07 17:02:45 - firstPhoneGap] ------------------------------
[2014-05-07 17:02:45 - firstPhoneGap] Android Launch!
[2014-05-07 17:02:45 - firstPhoneGap] adb is running normally.
[2014-05-07 17:02:45 - firstPhoneGap] Performing com.example.firstphonegap.test activity launch
[2014-05-07 17:02:45 - firstPhoneGap] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2014-05-07 17:02:49 - firstPhoneGap] Launching a new emulator with Virtual Device 'phoneGapAvd'
[2014-05-07 17:03:08 - firstPhoneGap] New emulator found: emulator-5554
[2014-05-07 17:03:08 - firstPhoneGap] Waiting for HOME ('android.process.acore') to be launched...
[2014-05-07 17:03:22 - firstPhoneGap] emulator-5554 disconnected! Cancelling 'com.example.firstphonegap.test activity launch'!

请大神指点下!
...全文
221 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dali_yan 2014-10-20
  • 打赏
  • 举报
回复
看看Log裏面的提示:“ Automatic Target Mode: Unable to detect device compatibility. Please select a target device.”這跟你的phoneGap搭建是沒有關係的,估計是你的模擬器有問題,使用真機調試吧
shall_chen 2014-10-19
  • 打赏
  • 举报
回复
phonegap + android 可以参考一下我之前写过的一篇博客 http://chenblog.sinaapp.com/?p=13
十三邵 2014-05-08
  • 打赏
  • 举报
回复
今天使用android+phonegap搭建环境,搞了一下午,都没弄出来,是根据http://www.phonegapcn.com/developers/get-started-13/get-started 这个教程来搭建的,真是郁闷死了?哪位牛人给点指点,本人没第一次搭建android平台 我也不知道,帮你顶一下吧。。。

80,471

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧