Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了离子运行android似乎工作,但该应用程序没有在手机上启动,为什么?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我的手机处于打开状态,处于调试模式,我已通过adb devices -l确认了这一点.
当我运行离子运行 android时,我得到Ionic声称应用程序启动时的输出,但手机上没有任何反应.我使用 Android 4.4.4的Nexus 5.
$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://scheR_354_11845@as.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
    @R_347_10586@l 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

android app中的index.html:

<!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>

解决方法

键入离子信息并检查已安装的Cordova版本.如果你有v5.0.0现在需要一个新的插件,否则所有的http请求都被阻止.

最近,cordova发布了cordova-android 4.0以及cordova cli的laster版本. cordova-android中的更改认情况下会阻止任何http请求.已经有一些关于这个问题的帖子.要解决这个问题,您只需添加cordova-whitelist-plugin即可.离子插件添加cordova-plugin-whitelist https://github.com/apache/cordova-plugin-whitelist
见参
https://forum.ionicframework.com/t/build-proccess-changed-and-now-cannot-call-to-api/25103

快乐的黑客:)

大佬总结

以上是大佬教程为你收集整理的离子运行android似乎工作,但该应用程序没有在手机上启动,为什么?全部内容,希望文章能够帮你解决离子运行android似乎工作,但该应用程序没有在手机上启动,为什么?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。