gpt4 book ai didi

java - 构建错误 : Jack requires Build Tools 24. 0.0 或更高版本

转载 作者:太空宇宙 更新时间:2023-11-03 12:15:33 25 4
gpt4 key购买 nike

我在我的 android 项目中使用 RX 库,由于某些原因,我需要将我的 build.gradle 设置为:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "com.urjapawar.bevyotp"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'io.reactivex:rxandroid:0.24.0'
}

我访问过thisthis too但无法修复它。我的项目代码是RegisterActivity.java

public class RegisterActivity extends AppCompatActivity {

EditText name,email,phonenumber,city;
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
name = (EditText) findViewById(R.id.nameinput);
email = (EditText) findViewById(R.id.emailinput);
phonenumber = (EditText) findViewById(R.id.phonenumber);
city = (EditText) findViewById(R.id.cityName);
final Pattern emailPattern = Pattern.compile(
"^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$");

Observable<Boolean> userNameValid = WidgetObservable.text(name) // [2]
.map(e -> e.text())
.map(t -> t.length() != 0);

Observable<Boolean> emailValid = WidgetObservable.text(email)
.map(e -> e.text())
.map(t -> emailPattern.matcher(t).matches());

Button registerButton = (Button) findViewById(R.id.button3);

Observable<Boolean> registerEnabled =
Observable.combineLatest(userNameValid, emailValid, (a, b) -> a && b);
// registerEnabled.subscribe(enabled -> registerButton.setEnabled(enabled));
emailValid.distinctUntilChanged()
.doOnNext(b -> Log.d("[Rx]", "Email " + (b ? "Valid" : "Invalid")))
.map(b -> b ? Color.BLACK : Color.RED)
.subscribe(color -> email.setTextColor(color));

userNameValid.distinctUntilChanged()
.doOnNext(b -> Log.d("[Rx]", "Uname " + (b ? "Valid" : "Invalid")))
.map(b -> b ? Color.BLACK : Color.RED)
.subscribe(color -> name.setTextColor(color));

// and registerEnabled

registerEnabled.distinctUntilChanged()
.doOnNext(b -> Log.d("[Rx]", "Button " + (b ? "Enabled" : "Disabled")))
.subscribe(enabled -> registerButton.setEnabled(enabled));

}
public void OTPbutton(View view){
startActivity(new Intent(RegisterActivity.this, ChooseActivity.class));
}


}

这是日志 Log

提前致谢

最佳答案

正如错误所说,您已经更改了 buildToolsVersion

buildToolsVersion "23.0.3" 

buildToolsVersion "24rc3" 这个。

buildToolsVersion = "24.0.0 rc1" 这个。

关于java - 构建错误 : Jack requires Build Tools 24. 0.0 或更高版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37673130/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com