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

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

Closed
rclai opened this issue Jun 10, 2019 · 2 comments · May be fixed by #84
Closed

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

rclai opened this issue Jun 10, 2019 · 2 comments · May be fixed by #84

Comments

@rclai
Copy link

rclai commented Jun 10, 2019

> 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
Copy link

@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
Copy link

moka77 commented Dec 6, 2019

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?

@rclai rclai closed this as completed May 9, 2020
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

Successfully merging a pull request may close this issue.

3 participants