{"action":"created","issue":{"url":"https://api.github.com/repos/kmagiera/react-native-gesture-handler/issues/362","repository_url":"https://api.github.com/repos/kmagiera/react-native-gesture-handler","labels_url":"https://api.github.com/repos/kmagiera/react-native-gesture-handler/issues/362/labels{/name}","comments_url":"https://api.github.com/repos/kmagiera/react-native-gesture-handler/issues/362/comments","events_url":"https://api.github.com/repos/kmagiera/react-native-gesture-handler/issues/362/events","html_url":"https://github.com/kmagiera/react-native-gesture-handler/issues/362","id":386054099,"node_id":"MDU6SXNzdWUzODYwNTQwOTk=","number":362,"title":"Could not find method compileOnly() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.","user":{"login":"maopixin","id":30068481,"node_id":"MDQ6VXNlcjMwMDY4NDgx","avatar_url":"https://avatars1.githubusercontent.com/u/30068481?v=4","gravatar_id":"","url":"https://api.github.com/users/maopixin","html_url":"https://github.com/maopixin","followers_url":"https://api.github.com/users/maopixin/followers","following_url":"https://api.github.com/users/maopixin/following{/other_user}","gists_url":"https://api.github.com/users/maopixin/gists{/gist_id}","starred_url":"https://api.github.com/users/maopixin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maopixin/subscriptions","organizations_url":"https://api.github.com/users/maopixin/orgs","repos_url":"https://api.github.com/users/maopixin/repos","events_url":"https://api.github.com/users/maopixin/events{/privacy}","received_events_url":"https://api.github.com/users/maopixin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-30T06:22:21Z","updated_at":"2018-12-01T06:49:25Z","closed_at":null,"author_association":"NONE","body":"I configure it according to official documents to use react-navigation3.0.2\r\nmy package.json\r\n```json\r\n{\r\n  \"name\": \"mpx\",\r\n  \"version\": \"0.0.1\",\r\n  \"private\": true,\r\n  \"scripts\": {\r\n    \"start\": \"node node_modules/react-native/local-cli/cli.js start\",\r\n    \"test\": \"jest\"\r\n  },\r\n  \"dependencies\": {\r\n    \"react\": \"16.3.1\",\r\n    \"react-native\": \"0.55.4\",\r\n    \"react-native-gesture-handler\": \"^1.0.10\",\r\n    \"react-native-scrollable-tab-view\": \"^0.10.0\",\r\n    \"react-native-vector-icons\": \"^6.1.0\",\r\n    \"react-navigation\": \"^3.0.2\",\r\n    \"teaset\": \"^0.5.10\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"babel-jest\": \"23.6.0\",\r\n    \"babel-preset-react-native\": \"4.0.1\",\r\n    \"jest\": \"23.6.0\",\r\n    \"react-test-renderer\": \"16.3.1\"\r\n  },\r\n  \"jest\": {\r\n    \"preset\": \"react-native\"\r\n  }\r\n}\r\n```\r\nand MainActivity.java\r\n```java\r\npackage com.mpx;\r\n\r\nimport com.facebook.react.ReactActivity;\r\n// add start （react-native-gesture-handler）\r\nimport com.facebook.react.ReactActivityDelegate;\r\nimport com.facebook.react.ReactRootView;\r\nimport com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;\r\n// add end\r\npublic class MainActivity extends ReactActivity {\r\n\r\n    /**\r\n     * Returns the name of the main component registered from JavaScript.\r\n     * This is used to schedule rendering of the component.\r\n     */\r\n    @Override\r\n    protected String getMainComponentName() {\r\n        return \"mpx\";\r\n    }\r\n    // add start （react-native-gesture-handler）\r\n    @Override\r\n    protected ReactActivityDelegate createReactActivityDelegate() {\r\n        return new ReactActivityDelegate(this, getMainComponentName()) {\r\n            @Override\r\n            protected ReactRootView createRootView() {\r\n                return new RNGestureHandlerEnabledRootView(MainActivity.this);\r\n            }\r\n        };\r\n    }\r\n    // add end\r\n}\r\n\r\n```\r\nthen react-native run-android\r\nfind error\r\n```bash\r\nFAILURE: Build failed with an exception.\r\n\r\n* Where:\r\nBuild file '/Users/mao/Desktop/lzbk/mpx/node_modules/react-native-gesture-handler/android/build.gradle' line: 32\r\n\r\n* What went wrong:\r\nA problem occurred evaluating project ':react-native-gesture-handler'.\r\n> Could not find method compileOnly() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.\r\n\r\n* Try:\r\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\r\n```\r\nI want to know how to solve it."},"comment":{"url":"https://api.github.com/repos/kmagiera/react-native-gesture-handler/issues/comments/443404891","html_url":"https://github.com/kmagiera/react-native-gesture-handler/issues/362#issuecomment-443404891","issue_url":"https://api.github.com/repos/kmagiera/react-native-gesture-handler/issues/362","id":443404891,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzQwNDg5MQ==","user":{"login":"scottajewell","id":18539446,"node_id":"MDQ6VXNlcjE4NTM5NDQ2","avatar_url":"https://avatars1.githubusercontent.com/u/18539446?v=4","gravatar_id":"","url":"https://api.github.com/users/scottajewell","html_url":"https://github.com/scottajewell","followers_url":"https://api.github.com/users/scottajewell/followers","following_url":"https://api.github.com/users/scottajewell/following{/other_user}","gists_url":"https://api.github.com/users/scottajewell/gists{/gist_id}","starred_url":"https://api.github.com/users/scottajewell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottajewell/subscriptions","organizations_url":"https://api.github.com/users/scottajewell/orgs","repos_url":"https://api.github.com/users/scottajewell/repos","events_url":"https://api.github.com/users/scottajewell/events{/privacy}","received_events_url":"https://api.github.com/users/scottajewell/received_events","type":"User","site_admin":false},"created_at":"2018-12-01T06:49:25Z","updated_at":"2018-12-01T06:49:25Z","author_association":"NONE","body":"In the Build file '/Users/mao/Desktop/lzbk/mpx/node_modules/react-native-gesture-handler/android/build.gradle', in the dependencies section change \"compileOnly\" to \"compile\".  I'm new to React Native so I'm not sure why, but I just looked at other packages in node_modules and found that they use \"compile\".  Good luck."}}
{"actor":{"display_login":"scottajewell"}}