Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when assembling Android release with proguard #13089

Closed
lyahdav opened this issue Mar 22, 2017 · 5 comments
Closed

Error when assembling Android release with proguard #13089

lyahdav opened this issue Mar 22, 2017 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@lyahdav
Copy link
Contributor

lyahdav commented Mar 22, 2017

Description

After creating a new React Native project, enabling proguard per these instructions, and building a release Android build I get the following error:

Note: there were 2 references to unknown classes.
      You should check your configuration for typos.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 654 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 7 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)
Warning: there were 1 unresolved references to library class members.
         You probably need to update the library versions.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
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

The specific warning in the output is:

Warning: com.facebook.fbui.textlayoutbuilder.proxy.StaticLayoutProxy: can't find referenced method 'StaticLayout(java.lang.CharSequence,int,int,android.text.TextPaint,int,android.text.Layout$Alignment,android.text.TextDirectionHeuristic,float,float,boolean,android.text.TextUtils$TruncateAt,int,int)' in library class android.text.StaticLayout

Reproduction

  1. react-native init --version="0.42.0" myapp
  2. cd myapp/android
  3. sed -i -e 's/enableProguardInReleaseBuilds = false/enableProguardInReleaseBuilds = true/g' app/build.gradle
  4. ./gradlew --offline assembleRelease
  5. Notice the error above

Solution

Don't know

Additional Information

  • React Native version: 0.42.0
  • Platform: Android
  • Development Operating System: Mac OS X 10.11.6
  • Dev tools: I have Android API levels 23-25 installed
@lyahdav
Copy link
Contributor Author

lyahdav commented Mar 23, 2017

Pretty sure this is duplicate of #11891.

@lyahdav lyahdav closed this as completed Mar 23, 2017
@jxr202
Copy link

jxr202 commented Jan 12, 2018

我有一个一样的问题,按 #11891的方法还是没解决,你的解决了么?

@aolphn
Copy link

aolphn commented Apr 14, 2018

@jxr202 你猜他能看懂不

@d-rahul
Copy link

d-rahul commented May 2, 2018

This issue is coming due to pro-guard enable in the release config of the app. So the solution is either remove pro-guard or put the indicated code snippet as in the link https://readyandroid.wordpress.com/errorexecution-failed-for-task-apptransformclassesandresourceswithproguardforrelease/

@Timmy-zzh
Copy link

@jxr202 我也遇到这个问题了,请问你解决了吗?

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants