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

undefined is not a function (evaluation '_reactNativeWallPaperManager2.default.setWallPaper') #4

Open
raghunathmestry opened this issue Oct 6, 2018 · 13 comments

Comments

@raghunathmestry
Copy link

raghunathmestry commented Oct 6, 2018

screenshot_20181006-162822

Please help me getting out of this.I Done all steps
step 1. react-native link react-native-wallpaper-manager
and i also remove
step 2.
@OverRide
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}

and i also link react-native-wallpaper-manager after the removing above code from WallPaperPackage.java but it is not working in android it gives me error undefined is not a function (evaluation '_reactNativeWallPaperManager2.default.setWallPaper') with this dependencies
"dependencies": {
"react": "16.3.1",
"react-data-fetching": "^0.2.2",
"react-dom": "^16.4.1",
"react-native": "~0.55.2",
"react-native-wallpaper-manager": "0.3.16"
}

"devDependencies": {
"babel-preset-react-native-stage-0": "^1.0.1",
"jest": "^23.4.1",
"jest-react-native": "^18.0.0",
"react-test-renderer": "16.3.1"
}

@Jalson1982
Copy link

Same here... any help guys on this?

@mountainfirefly
Copy link

@raghunathmestry @Jalson1982 you need to correctly access the setWallpaper function, there is typo in the function name.
Do it like this
WallPaperManager.setWallpaper({uri: 'http://example.com/test.png'}, (res)=> console.log(res));

@raghunathmestry
Copy link
Author

I do like this

ApplyWallpaper(link){
WallPaperManager.setWallPaper({uri:link}, (res)=> console.warn(res));
}

@raghunathmestry
Copy link
Author

yes you are right thanks for helping
It is Work for me

@antoinefotso
Copy link

undefined is not a function (evaluation '_reactNativeWallPaperManager2.default.setWallPaper')
still get this error😢

@raghunathmestry
Copy link
Author

WallPaperManager.setWallpaper({uri: 'http://example.com/test.png'}, (res)=> console.log(res));

copy that upper code in your code the difference is, replace setWallPaper to setWallpaper

@raghunathmestry
Copy link
Author

raghunathmestry commented Jul 15, 2019 via email

@mikeKane
Copy link

mikeKane commented Dec 3, 2019

I still get the error

TypeError: null is not an object (evaluating '_reactNative.NativeModules.WallPaperManager.setWallpaper')

This error is located at:
    in Home (created by ConnectFunction)
    in ConnectFunction (at SceneView.js:9)
    in SceneView (at createTabNavigator.js:39)
    in RCTView (at View.js:35)
    in View (at ResourceSavingScene.js:37)
    in RCTView (at View.js:35)
    in View (at ResourceSavingScene.js:26)
    in ResourceSavingScene (at createBottomTabNavigator.js:120)
    in RCTView (at View.js:35)
    in View (at screens.native.js:101)
    in ScreenContainer (at createBottomTabNavigator.js:110)
    in RCTView (at View.js:35)
    in View (at createBottomTabNavigator.js:109)
    in TabNavigationView (at createTabNavigator.js:197)
    in NavigationView (at createNavigator.js:80)
    in Navigator (at createAppContainer.js:430)
    in NavigationContainer (at NewTabNav.js:80)
    in NewTabNav (at App.js:114)
    in RCTView (at View.js:35)
    in View (at App.js:113)
    in Provider (at App.js:112)
    in App (at renderApplication.js:40)
    in RCTView (at View.js:35)
    in View (at AppContainer.js:98)
    in RCTView (at View.js:35)
    in View (at AppContainer.js:115)
    in AppContainer (at renderApplication.js:39)

setWallpaper
    index.bundle?platform=ios&dev=true&minify=false:143576:50
componentDidMount
    index.bundle?platform=ios&dev=true&minify=false:143256:58
commitLifeCycles
    index.bundle?platform=ios&dev=true&minify=false:22340:45
commitLayoutEffects
    index.bundle?platform=ios&dev=true&minify=false:24544:29
invokeGuardedCallbackImpl
    index.bundle?platform=ios&dev=true&minify=false:11851:21
invokeGuardedCallback
    index.bundle?platform=ios&dev=true&minify=false:11947:42
commitRootImpl
    index.bundle?platform=ios&dev=true&minify=false:24376:36
commitRootImpl
    [native code]:0
unstable_runWithPriority
    index.bundle?platform=ios&dev=true&minify=false:38953:30
commitRoot
    index.bundle?platform=ios&dev=true&minify=false:24245:24
commitRoot
    [native code]:0
runRootCallback
    index.bundle?platform=ios&dev=true&minify=false:23737:34
runRootCallback
    [native code]:0
flushImmediateQueueImpl
    index.bundle?platform=ios&dev=true&minify=false:15452:36
flushImmediateQueue
    index.bundle?platform=ios&dev=true&minify=false:15437:32
scheduleUpdateOnFiber
    index.bundle?platform=ios&dev=true&minify=false:23617:34
scheduleRootUpdate
    index.bundle?platform=ios&dev=true&minify=false:25095:21
render
    index.bundle?platform=ios&dev=true&minify=false:25809:26
renderApplication
    index.bundle?platform=ios&dev=true&minify=false:71313:78
run
    index.bundle?platform=ios&dev=true&minify=false:70963:28
runApplication
    index.bundle?platform=ios&dev=true&minify=false:71013:28
__callFunction
    index.bundle?platform=ios&dev=true&minify=false:2233:49
<unknown>
    index.bundle?platform=ios&dev=true&minify=false:1975:31
__guard
    index.bundle?platform=ios&dev=true&minify=false:2187:15
callFunctionReturnFlushedQueue
    index.bundle?platform=ios&dev=true&minify=false:1974:21
callFunctionReturnFlushedQueue
    [native code]:0

@mikeKane
Copy link

mikeKane commented Dec 3, 2019

I also see this in my android project

e/node_modules/react-native-wallpaper-manager/android/src/main/java/com/cunyutech/hollyliu/reactnative/wallpaper/WallPaperPackage.java:15: error: method does not override or implement a method from a supertype
    @Override
    ^
1 error


@stepupithubapp
Copy link

hello !!! isthere any one who can tell me how to use this library as i'm getting error
import WallPaperManager from 'react-native-wallpaper-manager';
WallPaperManager.setWallpaper({
uri: itemImage.largeImageURL
}, res => console.log(res));

its not working ....plz help me guys... thanks in advance

@laxman-patel
Copy link

Does this works now?
after changing the function name, it says => "ERROR TypeError: null is not an object (evaluating '_reactNative.NativeModules.WallPaperManager.setWallpaper')"

@kotsh23
Copy link

kotsh23 commented May 11, 2021

guys why there is no genus make Wallpaper module working with expo for us
WE POOR HERE GUYS

@antoinefotso
Copy link

@kotsh23 I don't think it's available for expo until you eject

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants