insightautos / cordova-gmv-barcode-scanner

A Cordova barcode scanning plugin based on the Google Mobile Vision library for iOS & Android.
MIT License
52 stars 77 forks source link

Showing Barcode Reader Sample app on Android #10

Closed mshoperi closed 5 years ago

mshoperi commented 5 years ago

Works great on iOS, but when installing on Android 2 apps are installed - the app itself, and then a Barcode Reader Sample app.

Why is there a second activity with the sample app?

gregavola commented 5 years ago

Same here - any ideas?

forrestmid commented 5 years ago

I don't really have any time at all right now to diagnose or fix this stuff, especially without an android device in hand. Getting the simulators running consistently is tough where I'm at due to internet access.

I expect that this has something to do with this line in the plugin.xml file and the fact there is a second activity not referencing BarcodeCaptureActivity:

<activity android:label="@string/title_activity_main" android:name="com.dealrinc.gmvScanner.SecondaryActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

Note there are two sections with this activity tag, one for each AndroidManifest location since I was trying to maintain compatibility with both cordova-android@7 & @5/6.

If someone can try to remove these couple activities and verify functionality and then submit a pull request that would be great!

brunoftmenezes commented 5 years ago

I discovered the problem, just delete the lines: <category android:name="android.intent.category.LAUNCHER" />

even without them the reader still works.

forrestmid commented 5 years ago

@brunoftmenezes There isn't a line in this entire project with that value, so it may be unrelated.

pjwl33 commented 5 years ago

cordova version 8.1.2 cordova android version 6.3.0 cordova-gmv-barcode-scanner version 1.2

android device is on Android OS 8.1.0

creates two icons when downloading the APK from the store. My app icon and then a Barcode Scanner Example application.

pjwl33 commented 5 years ago

i tried removing the lines you mentioned in plugins/cordova-gmv-barcode-scanner/plugin.xml and then rebuilding.

it still added those lines into the AndroidManifest.xml.

forrestmid commented 5 years ago

@pjwl33 I'm quite certain that the issue is based on the lines I commented on above. I've made a commit to remove them from the two sections they were showing up in. I think that may have been your issue.

forrestmid commented 5 years ago

To fix the issue for now you just need to install from the git repository rather than npm.

AngelaRg commented 5 years ago

Will this be solved on the version installed through npm?

forrestmid commented 5 years ago

It will be once I get around to deploying it on npm I'm just absurdly busy nowadays so I haven't gotten to it.

wvengen commented 5 years ago

If it's possible to find some time to publish a new version, please do so! Thanks for your efforts :)

gaguerrero commented 5 years ago

I downloaded the ZIP version from repository and then I copy de files into de plugins folder, built the app again , but still having the secondary app at the screen. What must id do ? Sorry about my english.

gaguerrero commented 5 years ago

Ok now it is working Just deleted the intent-filter section from plugin.xml at the node-module folder, in my case "C:\node\PreciosApp\src-cordova\node_modules\cordova-gmv-barcode-scanner\plugin.xml" and from "C:\node\PreciosApp\src-cordova\platforms\android\android.json". Thanks