Code Monkey home page Code Monkey logo

react-native-android-scanner's People

Contributors

aseemnishad avatar saunier-remi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-android-scanner's Issues

Build fails

Execution failed for task ':scanlibrary:transformNativeLibsWithStripDebugSymbolForRelease'.
> A problem occurred starting process '{project_path}/Library/Android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin/mips64el-linux-android-strip''

Any idea? ๐Ÿ™„

Update The Installation Steps of Android

Installation

$ npm install git+https://[email protected]/aseemnishad/react-native-android-scanner.git --save

  • In android/setting.gradle
...
include ':react-native-android-scanner'
project(':react-native-android-scanner').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-scanner/android')

include ':scanlibrary'
project(':scanlibrary').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-scanner/android/scanlibrary')
  • In android/app/build.gradle
    //New Updates :
...
dependencies {
    ...
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation project(':react-native-android-scanner')
    implementation project(':scanlibrary')
}
  • Add the required permissions in AndroidManifest.xml:

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    ...
    
    <application
      android:allowBackup="true"
  • Change the required in MainActivity.java`:

    from
    import com.scanlibrary.RNReactNativeAndroidScannerPackage;
    to 
    import com.reactlibrary.RNReactNativeAndroidScannerPackage;

Add to an Activity

Open your activity, usually located in android/app/src/main/java/[your package]/MainApplication.java.
Add import com.reactlibrary.RNReactNativeAndroidScannerPackage; to the imports at the top of the file.
Add new RNReactNativeAndroidScannerPackage() to the list returned by the getPackages() method.

error: cannot find symbol import android.support.v7.app.ActionBarActivity;

After having removed the android:allowBackup="false" line from my AndroidManifest.xml file, which prevented me to compile this project, I'm now facing the following compilation issue :

> Task :react-native-android-scanner:compileDebugJavaWithJavac FAILED
/Users/zedtux/Developments/companion/node_modules/react-native-android-scanner/android/src/main/java/com/reactlibrary/RNReactNativeAndroidScannerModule.java:11: error: cannot find symbol
import android.support.v7.app.ActionBarActivity;
                             ^
  symbol:   class ActionBarActivity
  location: package android.support.v7.app
1 error

Error calling RCTEventEmitter.receiverTouches

Hi, I installed the module by following your instructions and got the above error while pressing "Start Scan". it also says
"Exception calling object as function: Maximum call stack size exceeded. (unknow file >: 2274)"
Help me to resolve this.

Attribute application@allowBackup is also present at [:scanlibrary]

I'm giving a try to your project and I have the following error when running react-native run-android :

> Task :app:processDebugManifest FAILED
/Users/guillaumehain/Developments/companion/android/app/src/main/AndroidManifest.xml:12:7-34 Error:
        Attribute application@allowBackup value=(false) from AndroidManifest.xml:12:7-34
        is also present at [:scanlibrary] AndroidManifest.xml:20:9-35 value=(true).
        Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:8:5-25:19 to override.

Here is my AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.domain.myapp">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.CAMERA" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>

Crash when using with 64 bit

After upgrading our app to 64 bit (as Google requiers it for all apps to do by August 1st) we get the following crash, which happens when the scanner is getting opened.
Any idea how to solve it?

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.