React-native-fast-image: Android build failed.( ios ok) compileReleaseJavaWithJavac FAILED

Created on 20 Aug 2017  路  17Comments  路  Source: DylanVann/react-native-fast-image

hi, first installed package
on ios it builds success . but Android it fails:

`:react-native-fast-image:prepareComFacebookFrescoImagepipeline101Library
:react-native-fast-image:prepareComFacebookFrescoImagepipelineBase101Library
:react-native-fast-image:prepareComFacebookFrescoImagepipelineOkhttp3101Library
:react-native-fast-image:prepareComFacebookReactReactNative0451Library
:react-native-fast-image:prepareComFacebookSoloaderSoloader010Library
:react-native-fast-image:prepareOrgWebkitAndroidJscR174650Library
:react-native-fast-image:prepareReleaseDependencies
:react-native-fast-image:compileReleaseAidl
:react-native-fast-image:compileReleaseNdk UP-TO-DATE
:react-native-fast-image:compileLint
:react-native-fast-image:copyReleaseLint UP-TO-DATE
:react-native-fast-image:compileReleaseRenderscript
:react-native-fast-image:generateReleaseBuildConfig
:react-native-fast-image:generateReleaseResValues
:react-native-fast-image:generateReleaseResources
:react-native-fast-image:mergeReleaseResources
:react-native-fast-image:processReleaseManifest
/..../node_modules/react-native-fast-image/android/src/main/AndroidManifest.xml:11:9-15:15 Warning:
meta-data#com.bumptech.glide.integration.okhttp.OkHttpGlideModule was tagged at AndroidManifest.xml:11 to remove other declarations but no other declaration present
:react-native-fast-image:processReleaseResources
:react-native-fast-image:generateReleaseSources
:react-native-fast-image:incrementalReleaseJavaCompilationSafeguard
:react-native-fast-image:compileReleaseJavaWithJavac
:react-native-fast-image:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/..../node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageViewPackage.java:14: error: FastImageViewPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class FastImageViewPackage implements ReactPackage {
^
Note: /..../node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:react-native-fast-image:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-fast-image:compileReleaseJavaWithJavac'.

    Compilation failed; see the compiler error output 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

Total time: 8.256 secs`

Most helpful comment

when i edit node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageViewPackage.java
and add:
@Override public List<Class<? extends JavaScriptModule>> createJSModules(){ return Collections.emptyList(); }
it runs fine.
do you have a permanent fix?

All 17 comments

when i edit node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageViewPackage.java
and add:
@Override public List<Class<? extends JavaScriptModule>> createJSModules(){ return Collections.emptyList(); }
it runs fine.
do you have a permanent fix?

+1 I'm having the same issue

I already have the following and still getting the issue

@Override
    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

update RN to 0.47 did not solve this issue.

Any updates on this?

Same here

I was able to fix this by doing the following

Comment out the following code in
FastImageView Package

//@Override
    //public List<Class<? extends JavaScriptModule>> createJSModules() {
        //return Collections.emptyList();
    //}

And also in react video package not sure if it's related

//@Override
    //public List<Class<? extends JavaScriptModule>> createJSModules() {
        //return Collections.emptyList();
    //}

I ran in same problem but i discovered that i have old version of this package installed if you see the latest version you will not see this methods
so after i did npm uninstall react-native-fast-image then npm install react-native-fast-image fixed

48

same +1

update your fast image package file by this:---

package com.dylanvann.fastimage;
import com.dylanvann.fastimage.FastImageViewModule;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

import java.util.Collections;
import java.util.List;

public class FastImageViewPackage implements ReactPackage {
@Override
public List createNativeModules(ReactApplicationContext reactContext) {
return Collections.singletonList(new FastImageViewModule(reactContext));
}

@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
    return Collections.<ViewManager>singletonList(new FastImageViewManager());
}

@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
  return Collections.emptyList();
}

}

@rishabhsaxena9 This didn't do the trick on the last version

@DanGDroid 's solution fixed it for me. @DylanVann, should I create a PR with those changes?

@DanGDroid 's solution fixed it for me too. @Billydubb will you be creating that PR?

worked for me ! +1

https://github.com/DylanVann/react-native-fast-image/issues/47#issuecomment-323577547 fixed this issue on react-native 0.51.0.
please merge https://github.com/DylanVann/react-native-fast-image/pull/71

Note that the createJSModules() method needs to be inside the FastImageViewPackage class.

error without the method:

$ yarn list --pattern fast-image
鈹斺攢 [email protected]

$ cd android && ./gradlew installDebug --stacktrace --debug

11:36:36.662 [INFO] [org.gradle.api.internal.tasks.compile.JdkJavaCompiler] Compiling with JDK Java compiler API.
11:36:36.765 [ERROR] [system.err] /Users/gianfranco/app/mobileapp/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageViewPackage.java:14: error: FastImageViewPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
11:36:36.765 [ERROR] [system.err] public class FastImageViewPackage implements ReactPackage {
11:36:36.765 [ERROR] [system.err]        ^
11:36:36.781 [ERROR] [system.err] Note: /Users/gianfranco/app/mobileapp/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageViewManager.java uses unchecked or unsafe operations.
11:36:36.781 [ERROR] [system.err] Note: Recompile with -Xlint:unchecked for details.
11:36:36.781 [ERROR] [system.err] 1 error
11:36:36.786 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':react-native-fast-image:compileReleaseJavaWithJavac'
11:36:36.786 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :react-native-fast-image:compileReleaseJavaWithJavac FAILED
11:36:36.786 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :react-native-fast-image:compileReleaseJavaWithJavac (Thread[Daemon worker Thread 6,5,main]) completed. Took 0.155 secs.
11:36:36.787 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 6,5,main]] finished, busy: 0.315 secs, idle: 0.007 secs
11:36:36.788 [ERROR] [org.gradle.BuildExceptionReporter]
11:36:36.788 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:36:36.788 [ERROR] [org.gradle.BuildExceptionReporter]
11:36:36.788 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
11:36:36.788 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':react-native-fast-image:compileReleaseJavaWithJavac'.
11:36:36.788 [ERROR] [org.gradle.BuildExceptionReporter] > Compilation failed; see the compiler error output for details.

createJSModules is removed in newer React Native versions (>0.47.0). If you update you will not have this issue.

To simplify development of this package I'm only aiming to support the latest version, it may work for others, but I'm not including code for backward compatibility:

https://github.com/DylanVann/react-native-fast-image#supported-react-native-versions

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pehagg picture pehagg  路  3Comments

bhuvin25 picture bhuvin25  路  3Comments

kkarmalkar picture kkarmalkar  路  4Comments

mschipperheyn picture mschipperheyn  路  3Comments

kmilodenisglez picture kmilodenisglez  路  3Comments