Mit dem Upgrade auf Android Studio 3.0 von Android Studio 2.3.3, wo ich diese Datei bearbeitet hatte, simple.xml.ftl, um RelativeLayout und nicht ConstraintLayout zu verwenden, funktionierte alles bis zum Update, das ich posten werde zwei ftl Dateiformate unten. Meine Frage ist, warum passiert das? Ich habe das Fehlerprotokoll angeschaut und habe sehr wenig Lust, die ftl-Syntax zu lernen. Würde jemand den Code in diese Datei kopieren, die Android Studio 2.3.3 oder 3.0 hat und diese als Antwort posten. Der Pfad zu dieser Datei lautet "AndroidStudio/plugins/android/lib/templates/activities/common/root/res/layout /simple.xml.ftl" Öffnen Sie die Datei mit Notepad oder Sublime Text und kopieren Sie den Inhalt.Android Studio 3.0 kann keine Aktivitäten erstellen
Dies ist, was meine ursprüngliche Datei wie
sah<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
<#if hasAppBar && appBarLayoutName??>
tools:showIn="@layout/${appBarLayoutName}"
</#if>
tools:context="${relativePackage}.${fragmentClass}">
<#if isNewProject!false>
<TextView
<#if includeCppSupport!false>
android:id="@+id/sample_text"
</#if>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</#if>
</android.support.constraint.ConstraintLayout>
This is my change that worked until Android Studio 3.0
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
<#if hasAppBar && appBarLayoutName??>
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/${appBarLayoutName}"
</#if>
tools:context="${relativePackage}.${activityClpackageNamsNewProject!false>
<TextView
<#if includeCppSupport!false>
android:id="@+id/sample_text"
</#if>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</#if>
</RelativeLayout>
Feinarbeiten, die Frage zu überstimmen zahlreiche Änderungen an der FTL-Datei zu konstruieren, die korrekte Syntax alle versagt habe ich versucht, so abstimmend die Frage als Ergebnis von mir nicht langweilig Menschen mit gescheiterten Versuchen und ich habe auf zahlreiche SO-Post, die den Prozess adressiert die Tatsache, dass ich weiß, wie man das Problem beheben sollte sagen, ich habe etwas Forschung –
@ddekany Wenn ich posten Bei diesem Fehler können Sie die richtige FTL-Syntax für diese Frage vorschlagen oder die Datei simple.xml.ft freigeben l Datei, so kann ich zurück zum Schreiben von Code –