hieuvp / react-native-fingerprint-scanner

Provide Fingerprint, Touch ID, and Face ID Scanner for React Native (Compatible with both Android and iOS)
https://www.npmjs.com/package/react-native-fingerprint-scanner
871 stars 297 forks source link

Unable to create a release build after adding fingerprint-scanner library #20

Closed sahil290791 closed 6 years ago

sahil290791 commented 6 years ago

Update:

The app works fine if I add -ignorewarnings at the end of proguard-rules.pro. Not sure if this is the correct way of doing it. @hieuvp can you please confirm if this the right of doing it?

Description

The app works fine in debug mode, but the moment I try creating a release build, it keeps failing with this error:

Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack { okio.ByteString checkLowercase(okio.ByteString); }', but not the descriptor class 'okio.ByteString'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack { okio.ByteString access$100(okio.ByteString); }', but not the descriptor class 'okio.ByteString'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack$Reader { Hpack$Reader(int,okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack$Reader { Hpack$Reader(int,int,okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack$Writer { Hpack$Writer(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack$Writer { Hpack$Writer(int,okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack$Writer { void writeByteString(okio.ByteString); }', but not the descriptor class 'okio.ByteString'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { okhttp3.internal.framed.FrameReader newReader(okio.BufferedSource,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { okhttp3.internal.framed.FrameWriter newWriter(okio.BufferedSink,boolean); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { int readMedium(okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { void writeMedium(okio.BufferedSink,int); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { int access$300(okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { void access$600(okio.BufferedSink,int); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$ContinuationSource { Http2$ContinuationSource(okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$ContinuationSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$Reader { Http2$Reader(okio.BufferedSource,int,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$Writer { Http2$Writer(okio.BufferedSink,boolean); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$Writer { void data(boolean,int,okio.Buffer,int); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$Writer { void dataFrame(int,byte,okio.Buffer,int); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.NameValueBlockReader { NameValueBlockReader(okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.NameValueBlockReader$1 { NameValueBlockReader$1(okhttp3.internal.framed.NameValueBlockReader,okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.NameValueBlockReader$1 { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.PushObserver { boolean onData(int,okio.BufferedSource,int,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.PushObserver$1 { boolean onData(int,okio.BufferedSource,int,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3 { okhttp3.internal.framed.FrameReader newReader(okio.BufferedSource,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3 { okhttp3.internal.framed.FrameWriter newWriter(okio.BufferedSink,boolean); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3$Reader { Spdy3$Reader(okio.BufferedSource,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3$Writer { Spdy3$Writer(okio.BufferedSink,boolean); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3$Writer { void data(boolean,int,okio.Buffer,int); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3$Writer { void sendDataFrame(int,int,okio.Buffer,int); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Variant { okhttp3.internal.framed.FrameReader newReader(okio.BufferedSource,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Variant { okhttp3.internal.framed.FrameWriter newWriter(okio.BufferedSink,boolean); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream { Http1xStream(okhttp3.OkHttpClient,okhttp3.internal.connection.StreamAllocation,okio.BufferedSource,okio.BufferedSink); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream { Http1xStream(okhttp3.OkHttpClient,okhttp3.internal.connection.StreamAllocation,okio.BufferedSource,okio.BufferedSink); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream { void detachTimeout(okio.ForwardingTimeout); }', but not the descriptor class 'okio.ForwardingTimeout'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream { void access$400(okhttp3.internal.http.Http1xStream,okio.ForwardingTimeout); }', but not the descriptor class 'okio.ForwardingTimeout'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream$ChunkedSink { void write(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream$ChunkedSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream$FixedLengthSink { void write(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream$FixedLengthSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream$UnknownLengthSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http2xStream$StreamFinishingSource { Http2xStream$StreamFinishingSource(okhttp3.internal.http.Http2xStream,okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okhttp3.internal.http.RealResponseBody { RealResponseBody(okhttp3.Headers,okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.huc.BufferedRequestBody { void writeTo(okio.BufferedSink); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.huc.OutputStreamRequestBody { void initOutputStream(okio.BufferedSink,long); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.huc.OutputStreamRequestBody$1 { OutputStreamRequestBody$1(okhttp3.internal.huc.OutputStreamRequestBody,long,okio.BufferedSink); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.huc.StreamedRequestBody { void writeTo(okio.BufferedSink); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket { RealWebSocket(boolean,okio.BufferedSource,okio.BufferedSink,java.util.Random,java.util.concurrent.Executor,okhttp3.ws.WebSocketListener,java.lang.String); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket { RealWebSocket(boolean,okio.BufferedSource,okio.BufferedSink,java.util.Random,java.util.concurrent.Executor,okhttp3.ws.WebSocketListener,java.lang.String); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket { void sendPing(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket { void sendPong(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket$1 { void onPing(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket$1 { void onPong(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket$1$1 { RealWebSocket$1$1(okhttp3.internal.ws.RealWebSocket$1,java.lang.String,java.lang.Object[],okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketReader { WebSocketReader(boolean,okio.BufferedSource,okhttp3.internal.ws.WebSocketReader$FrameCallback); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketReader$1 { WebSocketReader$1(okhttp3.internal.ws.WebSocketReader,okhttp3.MediaType,okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketReader$FrameCallback { void onPing(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketReader$FrameCallback { void onPong(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketReader$FramedMessageSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter { WebSocketWriter(boolean,okio.BufferedSink,java.util.Random); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter { void writePing(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter { void writePong(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter { void writeControlFrameSynchronized(int,okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter { void writeMaskedSynchronized(okio.BufferedSource,long); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter$FrameSink { void write(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.ws.WebSocket { void sendPing(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.ws.WebSocketListener { void onPong(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okio.AsyncTimeout { void scheduleTimeout(okio.AsyncTimeout,long,boolean); }', but not the descriptor class 'okio.AsyncTimeout'
Note: the configuration keeps the entry point 'okio.AsyncTimeout { boolean cancelScheduledTimeout(okio.AsyncTimeout); }', but not the descriptor class 'okio.AsyncTimeout'
Note: the configuration keeps the entry point 'okio.AsyncTimeout { okio.Sink sink(okio.Sink); }', but not the descriptor class 'okio.Sink'
Note: the configuration keeps the entry point 'okio.AsyncTimeout { okio.Source source(okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okio.ForwardingSink { ForwardingSink(okio.Sink); }', but not the descriptor class 'okio.Sink'
Note: the configuration keeps the entry point 'okio.ForwardingSink { void write(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okio.ForwardingSource { ForwardingSource(okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okio.ForwardingSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: there were 3 references to unknown classes.
      You should check your configuration for typos.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 893 unkept descriptor classes in kept class members.
      You should consider explicitly keeping the mentioned classes
      (using '-keep').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 18 unresolved dynamic references to classes or interfaces.
      You should check if you need to specify additional program jars.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 5 accesses to class members by means of introspection.
      You should consider explicitly keeping the mentioned class members
      (using '-keep' or '-keepclassmembers').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
Warning: there were 2 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details

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

BUILD FAILED

I am using: React Native: 0.42.3 react-native-fingerprint-scanner: 2.2.0 compileSdkVersion: 25 buildToolsVersion "25.0.3" minSdkVersion 21 targetSdkVersion 25

I have even added these lines to proguard:

# MeiZu Fingerprint
-keep class com.fingerprints.service.** { *; }

# Samsung Fingerprint
-keep class com.samsung.** {*;}
fenglu09 commented 6 years ago

Have the same issues. Did you have solved it?

sahil290791 commented 6 years ago

I have added this code

android/app/proguard-rules.pro

# Samsung Fingerprint
-dontwarn com.samsung.**
-keep class com.samsung.android.sdk.** { *; }
-ignorewarnings

and it works fine after that.

phillbaker commented 6 years ago

Hi @sahil290791 I've recently been added to this repo as a collaborator and am getting up to speed on the different issues. So that we're all on the same page, do you mind posting the rest of your proguard file and the value of your enableProguardInReleaseBuilds?

phillbaker commented 6 years ago

I'd also point out that @sahil290791's reply is documented in the readme here: https://github.com/hieuvp/react-native-fingerprint-scanner#extra-configuration

Since there haven't been any updates, I'm going to close this issue for now.