wix-incubator / react-native-keyboard-input

Use your own custom input component instead of the system keyboard
MIT License
819 stars 150 forks source link

Library Android build tool version does not match latest RN 0.59 version #77

Closed rclai closed 4 years ago

rclai commented 5 years ago
> Configure project :reactnativekeyboardinput
WARNING: The specified Android SDK Build Tools version (25.0.0) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :reactnativekeyboardinput:compileDebugJavaWithJavac
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: /app/node_modules/react-native-keyboard-input/lib/android/src/main/java/com/wix/reactnativekeyboardinput/utils/ViewUtils.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 warnings

> Task :app:compileDebugJavaWithJavac FAILED
/app/android/app/src/main/java/com/tradeapp/MainApplication.java:39: error: incompatible types: <anonymous ReactNativeHost> cannot be converted to Application
            new KeyboardInputPackage(this)
                                     ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error

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. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
evancloutier commented 5 years ago

@rclai I think the issue you're seeing here is that this now refers to a ReactNativeHost class. You should see this error disappear if you call this.getApplication().

protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
    new KeyboardInputPackage(this.getApplication()) // (this = Android application object)
  );
}
moka77 commented 4 years ago

package android.example.myapp;

import android.app.Activity; import android.content.pm.PackageManager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.CheckBox; import android.widget.EditText; import android.widget.TextView;

import org.w3c.dom.Text;

import java.util.concurrent.atomic.AtomicInteger;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

}

public void onPointer(View view) {
    CheckBox newWord = (CheckBox)findViewById(R.id.simpleCheckBox);
    boolean word = newWord.isChecked();
    String string = "Hello world";
    displayQ(string);
    int qqq = 100;
    displayW(qqq);
}

private void displayW(boolean word) {
    TextView textView = (TextView)findViewById(R.id.simpleCheckBox);

}

private void displayQ(String string) {
    TextView textView = (TextView)findViewById(R.id.Pointer);
    textView.setTextSize(20);
    textView.setText(string);

}

}

What is Wrong?