简单的android.support.v4.app.FragmentTabHost的图形布局永远不会在Eclipse或Android Studio中呈现.
我得到的控制台错误始终如一:
Exception raised during rendering: No tab known for tag null
我正在使用最基本的XML文件:
<android.support.v4.app.FragmentTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TabWidget
android:id="@android:id/tabs"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0"/>
<FrameLayout
android:id="@+id/realtabcontent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
</android.support.v4.app.FragmentTabHost>
Run Code Online (Sandbox Code Playgroud)
但是会发生同样的错误.
我只是想在标签小部件和框架布局的上方或下方添加更多视图.
看到标签内容我并不在意; 我只是想看看我的其余部分 - 但问题是,当 android.support.v4.app.FragmentTabHost
布局中存在时,不会呈现任何其他视图.
我已阅读并尝试从这篇文章的答案中解决问题:
Android:底部带有FragmentTabHost的标签,
但我不认为这是我的问题; 我不打算在底部放一个TabWidget.
我的每个XML文件都完美打开.
Android Studio中出现同样的问题:
android android-layout android-support-library android-studio
当我尝试使用Android Studio中的“运行”按钮在设备上运行某个应用程序时,出现以下错误:
12/16 15:05:27: Launching app
$ adb push /Users/me/myproject/app/build/outputs/apk/app-debug.apk /data/local/tmp/com.mycompany.myproject
com.android.ddmlib.SyncException: Is a directory
Error while Installing APK
Run Code Online (Sandbox Code Playgroud)
自上次运行该项目以来,我还没有编辑过该项目中的任何文件,尽管从那时起Android Studio 可能已升级到Android Studio 2.2.3
。
我可以找到的最接近的错误是在SyncException的Google源代码中,除了这里我们看到的实际错误是Local path is a directory.
,与该错误不完全匹配。
根据我在中看到的app/build/outputs/apk/
,app-debug.apk
看起来像是一个合法的apk文件,即。不是目录。
我已经重新启动设备,从设备上卸载了应用程序,甚至还重新启动了计算机。
值得一提的是,我设备上的上一个应用是使用NativeScript构建的,并且具有相同的程序包名称。