darryncampbell / darryncampbell-cordova-plugin-intent

General purpose intent shim layer for cordova appliations on Android. Handles various techniques for sending and receiving intents.
MIT License
86 stars 136 forks source link

Zebra DataWedge and Ionic 3 Not working #39

Closed ovalMartinL closed 6 years ago

ovalMartinL commented 6 years ago

Hi. Any chance on getting an Ionic 3 update to this please?

I have a Zebra TC56 with physical scan button which I'm trying to get data from.

I have tried, but with no success.

My plugins are ...

com-darryncampbell-cordova-plugin-intent 1.0.0 "Intent Shim"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"

My home.ts code looks like this ...

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { WebIntent } from '@ionic-native/web-intent';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  data: any;

  constructor( public navCtrl: NavController, private webIntent: WebIntent ) {
    this.webIntent.startActivity( {
      action: this.webIntent.ACTION_VIEW,
      url: 'io.ionic.bp.ACTION',
      type: 'application/vnd.android.package-archive'
    } )
    .then(function( intent ){
      alert( JSON.stringify( intent.extras ) );
    }, function( err ) {
      alert( err );
    });
  }
}

I have also injected it into app.modules.ts.

I have also added the following into my AndroidManifest.xml file ...

<intent-filter>
   <action android:name="io.ionic.bp.ACTION" />
   <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

My config.xml has <widget id="io.ionic.bp" version="0.0.1" blah blah in it.

My DataWedge has an intent action of "io.ionic.bp.ACTION" and intent category has "android.intent.category.DEFAULT" and intent delivery of "Send via StartActivity."

When I run the app I get an error alert "Relative URIs are not supported." and then the alert changes to say "The connection to the server was unsuccessfull (file://android_asset/www.index.html)".

Any ideas?

darryncampbell commented 6 years ago

Hi, Datawedge is SENDING intents but your code above is also sending intents... the application needs to receive intents. There is actually a demo app available for scanning on Zebra devices with Ionic 3: https://github.com/Zebra/ZebraIonicDemo. It is only a first draft but should do what you are looking to achieve.

ovalMartinL commented 6 years ago

Ah that's great Darryn. It fails to build to android and the message is below.

Any ideas on what it could be?

ionic cordova build android
Running app-scripts build: --platform android --target cordova
[14:05:37]  build dev started ...
[14:05:37]  clean started ...
[14:05:37]  clean finished in 31 ms
[14:05:37]  copy started ...
[14:05:37]  deeplinks started ...
[14:05:38]  deeplinks finished in 174 ms
[14:05:38]  transpile started ...
[14:05:45]  transpile finished in 7.81 s
[14:05:45]  preprocess started ...
[14:05:45]  preprocess finished in 2 ms
[14:05:45]  webpack started ...
[14:05:46]  copy finished in 8.46 s
[14:05:54]  webpack finished in 9.05 s
[14:05:54]  sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[14:05:56]  sass finished in 1.79 s
[14:05:56]  postprocess started ...
[14:05:56]  postprocess finished in 22 ms
[14:05:56]  lint started ...
[14:05:56]  build dev finished in 19.33 s
> cordova build android
Android Studio project detected

ANDROID_HOME=C:\Users\Graham.Simmons\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_151
studio
Subproject Path: CordovaLib
Subproject Path: app
[14:06:03]  tslint: .../Users/Graham.Simmons/Desktop/Ionic/ionic3/ZebraIonicDemo/src/pages/home/home.ts, line: 43
            Property 'platform' is declared but never used.

      L42:      public events: Events, private changeDetectorRef: ChangeDetectorRef, private device: Device,
      L43:      private alertController: AlertController, private platform: Platform, private toastController: ToastCont

[14:06:03]  lint finished in 6.54 s
publishNonDefault is deprecated and has no effect anymore. All variants are now published.

The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_bc7fq6d47qptklytl2jezrs1m.run(C:\Users\Graham.Simmons\Desktop\Ionic\ionic3\ZebraIonicDemo\platforms\android\app\build.gradle:143)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
:CordovaLib:preBuild
 UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript
 UP-TO-DATE

:CordovaLib:checkDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:prepareLintJar UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:platformAttrExtractor UP-TO-DATE
:CordovaLib:processDebugManifest
 UP-TO-DATE
:CordovaLib:processDebugResources
 UP-TO-DATE
:CordovaLib:generateDebugSources
UP-TO-DATE
:CordovaLib:javaPreCompileDebug UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac
 UP-TO-DATE
:CordovaLib:processDebugJavaRes
 NO-SOURCE
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
 UP-TO-DATE

:app:preBuild UP-TO-DATE
:app:preDebugBuild
 UP-TO-DATE
:app:compileDebugAidl
 UP-TO-DATE
:CordovaLib:packageDebugRenderscript
 NO-SOURCE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources

UP-TO-DATE
:app:createDebugCompatibleScreenManifests
 UP-TO-DATE
:app:processDebugManifest
 UP-TO-DATE
:app:splitsDiscoveryTaskDebug UP-TO-DATE

:app:processDebugResources
C:\Users\Graham.Simmons\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0-alpha1.aar\e8b0b6af2fa9ccb4a1477f4a5f1aaef4\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/fontVariationSettings not found.

C:\Users\Graham.Simmons\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0-alpha1.aar\e8b0b6af2fa9ccb4a1477f4a5f1aaef4\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/ttcIndex not found.

C:\Users\Graham.Simmons\Desktop\Ionic\ionic3\ZebraIonicDemo\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:86: error: resource android:attr/fontVariationSettings not found.
C:\Users\Graham.Simmons\Desktop\Ionic\ionic3\ZebraIonicDemo\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:86: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Failed to execute aapt

com.android.ide.common.process.ProcessException: Failed to execute aapt

        at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796)
        at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551)
        at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285)
        at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:109)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:482)
        at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
        at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:794)
        ... 48 more
Caused by: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:462)
        at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
        at com.android.builder.internal.aapt.v2.QueueableAapt2.lambda$makeValidatedPackage$1(QueueableAapt2.java:179)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        ... 1 more
Caused by: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
        at com.android.builder.png.AaptProcess$NotifierProcessOutput.handleOutput(AaptProcess.java:454)
        at com.android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptProcess.java:411)
        at com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.java:332)
        at com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s

25 actionable tasks: 1 executed, 24 up-to-date
(node:11188) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
C:\Users\Graham.Simmons\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0-alpha1.aar\e8b0b6af2fa9ccb4a1477f4a5f1aaef4\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/fontVariationSettings not found.

C:\Users\Graham.Simmons\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0-alpha1.aar\e8b0b6af2fa9ccb4a1477f4a5f1aaef4\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/ttcIndex not found.

C:\Users\Graham.Simmons\Desktop\Ionic\ionic3\ZebraIonicDemo\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:86: error: resource android:attr/fontVariationSettings not found.
C:\Users\Graham.Simmons\Desktop\Ionic\ionic3\ZebraIonicDemo\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:86: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
        at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796)
        at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551)
        at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285)
        at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:109)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:482)
        at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
        at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:794)
        ... 48 more
Caused by: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:462)
        at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
        at com.android.builder.internal.aapt.v2.QueueableAapt2.lambda$makeValidatedPackage$1(QueueableAapt2.java:179)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        ... 1 more
Caused by: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
        at com.android.builder.png.AaptProcess$NotifierProcessOutput.handleOutput(AaptProcess.java:454)
        at com.android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptProcess.java:411)
        at com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.java:332)
        at com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
darryncampbell commented 6 years ago

That looks like the same issue as https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent/issues/38 and I need to update the version of the plugin in the demo project. Can you please ensure version 1.0.0 of the plugin is installed? ionic cordova plugin remove com-darryncampbell-cordova-plugin-intent ionic cordova plugin add com-darryncampbell-cordova-plugin-intent ionic cordova plugin ls

Thanks for finding this.

ovalMartinL commented 6 years ago

Thanks again Darryn. It built successfully and works 100% on the TC56 👍 You are a life saver :)

ovalMartinL commented 6 years ago

1 more question. When I run ionic serve the browser shows an error (shown below) and thus makes it hard to develop the UI.

Any ideas?

Error: Uncaught (in promise): TypeError: Cannot read property 'intentShim' of undefined
TypeError: Cannot read property 'intentShim' of undefined
    at new BarcodeProvider (http://localhost:8100/build/main.js:337:24)
    at createClass (http://localhost:8100/build/vendor.js:12517:20)
    at _createProviderInstance (http://localhost:8100/build/vendor.js:12494:20)
    at createProviderInstance (http://localhost:8100/build/vendor.js:12337:12)
    at createViewNodes (http://localhost:8100/build/vendor.js:13789:53)
    at createRootView (http://localhost:8100/build/vendor.js:13692:5)
    at callWithDebugContext (http://localhost:8100/build/vendor.js:15093:42)
    at Object.debugCreateRootView [as createRootView] (http://localhost:8100/build/vendor.js:14394:12)
    at ComponentFactory_.create (http://localhost:8100/build/vendor.js:11313:46)
    at ComponentFactoryBoundToModule.create (http://localhost:8100/build/vendor.js:4275:29)
    at c (http://localhost:8100/build/polyfills.js:3:19752)
    at Object.reject (http://localhost:8100/build/polyfills.js:3:19174)
    at NavControllerBase._fireError (http://localhost:8100/build/vendor.js:48522:16)
    at NavControllerBase._failed (http://localhost:8100/build/vendor.js:48515:14)
    at http://localhost:8100/build/vendor.js:48562:59
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14976)
    at Object.onInvoke (http://localhost:8100/build/vendor.js:4982:33)
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14916)
    at r.run (http://localhost:8100/build/polyfills.js:3:10143)
    at http://localhost:8100/build/polyfills.js:3:20242
darryncampbell commented 6 years ago

Happy to help. I will close this issue once I update the Zebra app to use plugin version 1.0.0. Ionic serve relies on a pre-built Android application with only a subset of available plugins. The intent plugin (com-darryncampbell-cordova-plugin-intent AKA intentShim) is unfortunately not one of those. That is my understanding at least.

ovalMartinL commented 6 years ago

Is this why the browser URL chrome://inspect just shows a blank window too? How am I supposed to see the console.logs of the provider?

To build the UI of an app would you say it's best to detect the platform and then only run the construct code of home.ts and barcode.ts if need be?

darryncampbell commented 6 years ago

I use chrome://inspect and observe the javascript logs that way. Chrome://inspect shouldn't show a blank window, it should mirror what is shown on the physical device but yes, to test the scanning logic you need to be running on a real device. If it were me, like yourself I would develop the UI with ionic serve then move to the real device to build the scanning logic.

ovalMartinL commented 6 years ago

I've put if( platform.is('cordova') ) {} around the construct code in home.ts and barcode.ts and now the chrome browser loads the app, so I can design the UI now. I just upgraded from Chrome v64 to v65 and now my chrome inspect works :)

Thank you very very much Darryn for all your help.

darryncampbell commented 6 years ago

I'm glad it's working. Look out for a future webinar / blog post on this topic but I don't have a timeline for that yet.

arvind8311 commented 4 years ago

Hi darry ,

I am getting error typerror can not read property of undefined in browser and blank page in ionic android all . Pls help

darryncampbell commented 4 years ago

Hi @arvind8311 please take a look at the official sample app: https://github.com/Zebra/ZebraIonicDemo . If there are issues, please open a separate issue.