我正在关注下载android studio的一个课程以及如何设置它,我已经为我的手机下载了正确的驱动程序,但是当我尝试运行我的Hello World程序时,我遇到了问题。无法运行Hello world
请记住,课程本身建议我更新名为activity_main.xml的文件。这是该文件以前的内容:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
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/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.udacity.myapplication.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintLeft_toLeftOf="@+id/activity_main"
app:layout_constraintTop_toTopOf="@+id/activity_main"
app:layout_constraintRight_toRightOf="@+id/activity_main"
app:layout_constraintBottom_toBottomOf="@+id/activity_main" />
</android.support.constraint.ConstraintLayout>
这段代码必须更新以与视频保持一致。新段:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.udacity.myapplication.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</RelativeLayout>
当我尝试我的手机在这里运行的应用程序是我所得到的:
Error:(7, 28) No resource found that matches the given name (at ‘paddingBottom’ with value ‘@dimen/activity_vertical_margin’).
Error:(8, 26) No resource found that matches the given name (at ‘paddingLeft’ with value ‘@dimen/activity_horizontal_margin’).
Error:(9, 27) No resource found that matches the given name (at ‘paddingRight’ with value ‘@dimen/activity_horizontal_margin’).
Error:(10, 25) No resource found that matches the given name (at ‘paddingTop’ with value ‘@dimen/activity_vertical_margin’).
Error:Execution failed for task ‘:app:processDebugResources’.
任何帮助吗?
,你有 * 5dp 1dp *? –
yasin