###前提・実現したいこと
下記のサンプルを動かしたいのですが、エラーが出て動かすことが出来ません。
example-react-native-redux
###発生している問題・エラーメッセージ
example-react-native-redux\Counter\android\app\src\main\java\com\counter\MainApplication.java:19: エラー: <anonymous com.counter.MainApplication$1>のgetUseDeveloperSupport()はReactNativeHostのgetUseDeveloperSupport()をオーバーライドできません protected boolean getUseDeveloperSupport() { ^ (public)より弱いアクセス権限を割り当てようとしました エラー1個 :app:compileDebugJavaWithJavac FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > 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: 9 mins 12.35 secs Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html
###該当のソースコード
java
1package com.counter; 2 3import android.app.Application; 4import android.util.Log; 5 6import com.facebook.react.ReactApplication; 7import com.facebook.react.ReactInstanceManager; 8import com.facebook.react.ReactNativeHost; 9import com.facebook.react.ReactPackage; 10import com.facebook.react.shell.MainReactPackage; 11 12import java.util.Arrays; 13import java.util.List; 14 15public class MainApplication extends Application implements ReactApplication { 16 17 private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 @Override 19 protected boolean getUseDeveloperSupport() { 20 return BuildConfig.DEBUG; 21 } 22 23 @Override 24 protected List<ReactPackage> getPackages() { 25 return Arrays.<ReactPackage>asList( 26 new MainReactPackage() 27 ); 28 } 29 }; 30 31 @Override 32 public ReactNativeHost getReactNativeHost() { 33 return mReactNativeHost; 34 } 35} 36
json
1{ 2 "name": "Counter", 3 "version": "0.0.1", 4 "private": true, 5 "scripts": { 6 "start": "react-native start", 7 "setup_project": "npm run step1; npm run step2", 8 "step1": "rm -rf node_modules/react-native/node_modules/react; rm -rf node_modules/react-native/node_modules/fbjs; rm -rf node_modules/react/node_modules/fbjs", 9 "step2": "cd node_modules; find . -name .babelrc | grep -v packager | xargs rm" 10 }, 11 "dependencies": { 12 "react": "15.5.4", 13 "react-native": "0.44.2", 14 "react-redux": "5.0.5", 15 "redux": "3.6.0", 16 "redux-actions": "2.0.3", 17 "redux-thunk": "2.2.0" 18 } 19} 20
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。