我的手机上,并在调试模式我已经证实了这一点与 ADB设备-l
。
当我运行离子运行Android,我得到以下离子输出声称,应用程序启动,但没有任何反应了电话。我用一台Nexus 5与Android 4.4.4。
$离子运行Android
增加身体类:平台的android
运行命令:/用户/的Kristoffer /网络/ photoApp /平台/安卓/科尔多瓦/运行
构建文件:/Users/kristoffer/web/photoApp/platforms/android/build.xml
-set模式检查:
-set-调试文件:
-check-ENV:
[checkenv] Android的SDK工具版本22.6.2
[checkenv]安装在/开发/ ADT-包/ SDK
-建立:
[回应]项目名称:KvittoScanner
[的GetType]项目类型:应用程序
-set调试模式:
-debug-混淆检查:
- pre-构建:
-build-设置:
[getbuildtools]使用最新版本的工具:19.0.3
[回应]解决构建目标的KvittoScanner ...
[getTarget方法]项目目标:安卓4.4.2
[getTarget方法] API级别:19
[回声] - - - - -
[回应]如果需要创建输出目录...
[回声] - - - - -
[回应]解决依赖于KvittoScanner ...
[相关]库的依赖关系:
[相关]
[相关] ------------------
[相关]有序库:
[相关]
[相关] ------------------
[回声] - - - - -
[回应]图书馆建设与调试...
nodeps:
-set模式检查:
-set-调试文件:
-check-ENV:
[checkenv] Android的SDK工具版本22.6.2
[checkenv]安装在/开发/ ADT-包/ SDK
-建立:
[回应]项目名称:CordovaLib
[的GetType]项目类型:安卓库
-set调试模式:
-debug-混淆检查:
- pre-构建:
-build-设置:
[getbuildtools]使用最新版本的工具:19.0.3
[回应]解决构建目标的CordovaLib ...
[getTarget方法]项目目标:安卓4.4.2
[getTarget方法] API级别:19
[回声] - - - - -
[回应]如果需要创建输出目录...
[回声] - - - - -
[回应]解决依赖于CordovaLib ...
[相关]库的依赖关系:
[相关]无库
[相关]
[相关] ------------------
- code-创:
[mergemanifest]找到删除目标文件
[mergemanifest]合并AndroidManifest文件合并为一个。
[mergemanifest]清单合并禁用。使用项目清单而已。
[回应]使用AIDL文件...
[AIDL]没有AIDL文件进行编译。
[回声] - - - - -
[回应]处理RenderScript文件...
[回声] - - - - -
[回应]处理资源...
[AAPT]找到修改的输入文件
[AAPT]生成资源ID ...
[回声] - - - - -
[回应]处理BuildConfig类...
[buildconfig]无需产生新的BuildConfig。
- pre-编译:
-compile:
[回应]创建库的输出jar文件...
-post编译:
-obfuscate:
-dex:
[回应]库项目:不转换字节code ...
-crunch:
[危机]在源代码目录嘎吱嘎吱PNG文件:/用户/的Kristoffer /网络/ photoApp /平台/安卓/ CordovaLib / RES
[紧缩]到目标目录:/用户/的Kristoffer /网络/ photoApp /平台/安卓/ CordovaLib /蚂蚁建造/ RES
[危机]嘎吱嘎吱0 PNG文件更新缓存
-package-资源:
[回应]库项目:不打包的资源...
-包:
[回应]库项目:不打包的apk ...
-post包:
-DO调试:
[回应]库项目:不创建APK ...
[propertyfile]更新属性文件:/Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile]更新属性文件:/Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile]更新属性文件:/Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile]更新属性文件:
/Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/build.prop
-post建造:
调试:
- code-创:
[mergemanifest]找到删除目标文件
[mergemanifest]合并AndroidManifest文件合并为一个。
[mergemanifest]清单合并禁用。使用项目清单而已。
[回应]使用AIDL文件...
[AIDL]没有AIDL文件进行编译。
[回声] - - - - -
[回应]处理RenderScript文件...
[回声] - - - - -
[回应]处理资源...
[AAPT]找到修改的输入文件
[AAPT]生成资源ID ...
[回声] - - - - -
[回应]处理BuildConfig类...
[buildconfig]无需产生新的BuildConfig。
- pre-编译:
[回应]设置罐子路径:/Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/classes.jar
-compile:
[javac的] 2编译源文件/用户/的Kristoffer /网络/ photoApp /平台/安卓/蚂蚁建造/班
-post编译:
-obfuscate:
-dex:
[DEX]输入:/用户/的Kristoffer /网络/ photoApp /平台/安卓/蚂蚁建造/班
[DEX]输入:/Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/classes.jar
[DEX]使用pre-Dexed类 - d889c6bd0911025d0e9120cf57234197.jar< - /Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/classes.jar
[DEX]找到修改的输入文件
[DEX]编译的文件和外部的库转换成/Users/kristoffer/web/photoApp/platforms/android/ant-build/classes.dex ...
[DX]合并DEX A(14 DEFS / 28.2KiB)与DEX B(206 DEFS / 314.1KiB)。结果是220 DEFS / 415.6KiB。拿了0.3秒
-crunch:
[危机]在源代码目录嘎吱嘎吱PNG文件:/用户/的Kristoffer /网络/ photoApp /平台/安卓/ RES
[紧缩]到目标目录:/用户/的Kristoffer /网络/ photoApp /平台/安卓/蚂蚁建造/ RES
[危机]嘎吱嘎吱0 PNG文件更新缓存
-package-资源:
[AAPT]找到修改的输入文件
[AAPT]创建完整的资源包...
[AAPT](跳过文件'.bower.json由于ANDROID_AAPT_IGNORE模式。*)
[AAPT](跳过文件'.bower.json由于ANDROID_AAPT_IGNORE模式。*)
[AAPT](跳过文件'.bower.json由于ANDROID_AAPT_IGNORE模式。*)
[AAPT](跳过文件'.bower.json由于ANDROID_AAPT_IGNORE模式。*)
[AAPT](跳过文件'.bower.json由于ANDROID_AAPT_IGNORE模式。*)
[AAPT]警告:AndroidManifest.xml中已经定义了调试的(在http://schemas.android.com/apk/res/android);使用清单现有值。
-包:
[apkbuilder]找到修改的输入文件
[apkbuilder]创建KvittoScanner调试,unaligned.apk和调试密钥签名吧...
-post包:
-DO调试:
[zipalign]运行压缩调整对最终的apk ...
[回应]调试套餐:/Users/kristoffer/web/photoApp/platforms/android/ant-build/KvittoScanner-debug.apk
[propertyfile]更新属性文件:/Users/kristoffer/web/photoApp/platforms/android/ant-build/build.prop
[propertyfile]更新属性文件:/Users/kristoffer/web/photoApp/platforms/android/ant-build/build.prop
[propertyfile]更新属性文件:/Users/kristoffer/web/photoApp/platforms/android/ant-build/build.prop
[propertyfile]更新属性文件:/Users/kristoffer/web/photoApp/platforms/android/ant-build/build.prop
-post建造:
[移动]移动1文件/用户/的Kristoffer /网络/ photoApp /平台/安卓/ ANT-构建
[移动]移动1文件/用户/的Kristoffer /网络/ photoApp /平台/安卓/ CordovaLib / ANT-构建
调试:
BUILD SUCCESSFUL
总时间:5秒
警告:不指定目标,部署到设备05f2fdad3444ea60。
使用APK:/Users/kristoffer/web/photoApp/platforms/android/ant-build/KvittoScanner-debug-unaligned.apk
在设备上安装应用程序...
启动应用程序...
LAUNCH成功
index.html的在Android应用程序:
<!DOCTYPE HTML>
< HTML>
< HEAD>
<元字符集=utf-8>
< META NAME =视CONTENT =初始规模= 1,最大规模= 1,用户可扩展=没有,宽=设备宽度>
<冠军>< /标题>
<链接HREF =LIB /离子/ CSS / ionic.css相对=样式>
<链接HREF =CSS / style.css的相对=样式>
<! - 如果使用萨斯(运行一饮而尽SASS第一),取消注释下面然后,取下CSS包括上述
<链接HREF =CSS / ionic.app.css相对=样式>
- >
<! - 离子/ angularjs JS - >
<脚本SRC =LIB /离子/ JS / ionic.bundle.js>< / SCRIPT>
&所述;! - ngCordova - >
<脚本SRC =LIB / NG-cordova.min.js>< / SCRIPT>
&所述;! - 科尔多瓦脚本(这将是一个404发育过程中) - >
&所述;脚本的src =cordova.js>&所述; /脚本>
<! - 您的应用程序的JS - >
<脚本SRC =JS / app.js>< / SCRIPT>
<脚本SRC =JS / controllers.js>< / SCRIPT>
<脚本SRC =JS / services.js>< / SCRIPT>
< /头>
<身体NG-应用程序=启动器动画=滑 - 左 - 右 - ios7级=平台的Android平台科尔多瓦平台的WebView>
<! -
导航栏,我们定位的观点之间,将被更新。
- >
<离子导航栏类=酒吧,稳定的导航,标题幻灯片ios7>
<离子NAV-后退按钮级=按钮图标图标离子ios7箭头回>
背部
< /离子NAV-后退按钮>
< /离子导航栏>
<! -
离子导航视图>该意见将在&lt呈现;指令以下
模板是在/ Templates文件夹中(但你也可以
在这个HTML文件模板内联,如果你想)。
- >
<离子NAV-视图>< /离子NAV-视图>
< /身体GT;
< / HTML>
解决方案
我有同样的问题有时回来。其中的原因是我的源文件的WWW /文件夹中并没有包含在index.html的有cordova.js。如果有人面对这个问题,一定要确保在源文件添加cordova.js像
<脚本SRC =cordova.js>< / SCRIPT>
My phone is on and in debug-mode I have confirmed this with adb devices -l
.
When I run ionic run android, I get the output below Ionic claims that the application is launched, but nothing happens on the phone. I use a Nexus 5 with android 4.4.4.
$ ionic run android
add to body class: platform-android
Running command: /Users/kristoffer/web/photoApp/platforms/android/cordova/run
Buildfile: /Users/kristoffer/web/photoApp/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at /Development/adt-bundle/sdk
-setup:
[echo] Project Name: KvittoScanner
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for KvittoScanner...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for KvittoScanner...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at /Development/adt-bundle/sdk
-setup:
[echo] Project Name: CordovaLib
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for CordovaLib...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
[echo] Creating library output jar file...
-post-compile:
-obfuscate:
-dex:
[echo] Library project: do not convert bytecode...
-crunch:
[crunch] Crunching PNG Files in source dir: /Users/kristoffer/web/photoApp/platforms/android/CordovaLib/res
[crunch] To destination dir: /Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[echo] Library project: do not package resources...
-package:
[echo] Library project: do not package apk...
-post-package:
-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Updating property file: /Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file:
/Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/build.prop
-post-build:
debug:
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
[echo] Set jars path to: /Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/classes.jar
-compile:
[javac] Compiling 2 source files to /Users/kristoffer/web/photoApp/platforms/android/ant-build/classes
-post-compile:
-obfuscate:
-dex:
[dex] input: /Users/kristoffer/web/photoApp/platforms/android/ant-build/classes
[dex] input: /Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Using Pre-Dexed classes-d889c6bd0911025d0e9120cf57234197.jar <- /Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Found modified input file
[dex] Converting compiled files and external libraries into /Users/kristoffer/web/photoApp/platforms/android/ant-build/classes.dex...
[dx] Merged dex A (14 defs/28.2KiB) with dex B (206 defs/314.1KiB). Result is 220 defs/415.6KiB. Took 0.3s
-crunch:
[crunch] Crunching PNG Files in source dir: /Users/kristoffer/web/photoApp/platforms/android/res
[crunch] To destination dir: /Users/kristoffer/web/photoApp/platforms/android/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] Found modified input file
[aapt] Creating full resource package...
[aapt] (skipping file '.bower.json' due to ANDROID_AAPT_IGNORE pattern '.*')
[aapt] (skipping file '.bower.json' due to ANDROID_AAPT_IGNORE pattern '.*')
[aapt] (skipping file '.bower.json' due to ANDROID_AAPT_IGNORE pattern '.*')
[aapt] (skipping file '.bower.json' due to ANDROID_AAPT_IGNORE pattern '.*')
[aapt] (skipping file '.bower.json' due to ANDROID_AAPT_IGNORE pattern '.*')
[aapt] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
-package:
[apkbuilder] Found modified input file
[apkbuilder] Creating KvittoScanner-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /Users/kristoffer/web/photoApp/platforms/android/ant-build/KvittoScanner-debug.apk
[propertyfile] Updating property file: /Users/kristoffer/web/photoApp/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /Users/kristoffer/web/photoApp/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /Users/kristoffer/web/photoApp/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /Users/kristoffer/web/photoApp/platforms/android/ant-build/build.prop
-post-build:
[move] Moving 1 file to /Users/kristoffer/web/photoApp/platforms/android/ant-build
[move] Moving 1 file to /Users/kristoffer/web/photoApp/platforms/android/CordovaLib/ant-build
debug:
BUILD SUCCESSFUL
Total time: 5 seconds
WARNING : No target specified, deploying to device '05f2fdad3444ea60'.
Using apk: /Users/kristoffer/web/photoApp/platforms/android/ant-build/KvittoScanner-debug-unaligned.apk
Installing app on device...
Launching application...
LAUNCH SUCCESS
index.html in the android app:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- ngCordova -->
<script src="lib/ng-cordova.min.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
</head>
<body ng-app="starter" animation="slide-left-right-ios7" class="platform-android platform-cordova platform-webview">
<!--
The nav bar that will be updated as we navigate between views.
-->
<ion-nav-bar class="bar-stable nav-title-slide-ios7">
<ion-nav-back-button class="button-icon icon ion-ios7-arrow-back">
Back
</ion-nav-back-button>
</ion-nav-bar>
<!--
The views will be rendered in the <ion-nav-view> directive below
Templates are in the /templates folder (but you could also
have templates inline in this html file if you'd like).
-->
<ion-nav-view></ion-nav-view>
</body>
</html>
解决方案
I had the same problem sometime back. The reason for that was my source files in www/ folder didn't had cordova.js included in the index.html. If someone faces this problem, do make sure to add cordova.js in the source files like
<script src="cordova.js"></script>