安卓工作室错误"Android resource compilation failed"



我最近下载了Android studio for windows 10,这是我的第一个项目,ide运行良好,但当我测试它时,它给出了图片中显示的错误

在此处输入图像描述

这是java代码。

package pro.haha_yes_appss.goproooooooooooooooooooooooo;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebViewClient;
public class youtube extends AppCompatActivity {
private WebView webView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
webView = (WebView) findViewById(R.id.webview);
webView.setWebViewClient(new WebViewClient())
webView.loadurl("https://www.youtube.com/c/TuckerBudzyn/featured")
}
}

如果它必须对我的xml样式文件做任何事情,那么这里是

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="https://www.youtube.com/c/TuckerBudzyn/featured">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<WebView
android:id="@/id+webview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>

ps我遵循了一个教程这里是它的链接

https://www.youtube.com/watch?v=TUXui5ItBkM

布局文件中Web视图的id应为以下格式:

android:id="@+id/webview"

不是

android:id="@/id+webview"

相关内容

最新更新