phonegap / phonegap-plugin-barcodescanner

cross-platform BarcodeScanner for Cordova / PhoneGap
MIT License
1.27k stars 1.39k forks source link

com.google.zxing.client can't be resolved #857

Closed subashdbc closed 3 years ago

subashdbc commented 4 years ago

Hi, I am trying to use barcodescanner in one of our cordova projects. To do that I run this command, cordova plugin add phonegap-plugin-barcodescanner this is added successfully, but in this package com.phonegap.plugins.barcodescanner

The below lines shows, it can't be resolved

import com.google.zxing.client.android.CaptureActivity;
import com.google.zxing.client.android.encode.EncodeActivity;
import com.google.zxing.client.android.Intents;

Is there anything that needs to be added extra? Please help since I am new to this development

Thanks in advance!

subashdbc commented 4 years ago

Any helpful comments!!!!

adrianjarc commented 4 years ago

Could be related to #860 . And it cant resolve them because activity wasn't declared. In cases where it happens I successfully fixed it with adding:

<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
  <activity android:name="com.google.zxing.client.android.CaptureActivity" android:clearTaskOnLaunch="true" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden" android:exported="false"/>
  <activity android:name="com.google.zxing.client.android.encode.EncodeActivity" android:label="Share"/>
</edit-config>

to config.xml under <platform name="android"> tag

captainjapeng commented 4 years ago

Could be related to #860 . And it cant resolve them because activity wasn't declared. In cases where it happens I successfully fixed it with adding:

<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
  <activity android:name="com.google.zxing.client.android.CaptureActivity" android:clearTaskOnLaunch="true" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden" android:exported="false"/>
  <activity android:name="com.google.zxing.client.android.encode.EncodeActivity" android:label="Share"/>
</edit-config>

to config.xml under <platform name="android"> tag

Adding this one prevents the app from starting

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

TravBradfield commented 3 years ago

@subashdbc

Did you have any luck, friend? Please share your experiences. I'm having the same problem.