0

https://github.com/yabushi/TimeStampCamera

をRUNしようとすると、以下のエラーが出てしまいます。

Layoutファイルのactivity_mainの6行目か、Mainアクティビティの54行目あたりに不具合があるようなのですが、対処法がわかりません。

XMLファイルでの各要素の定義の仕方に異常があるのでしょうか。

Process: com.example.shigeki.timestampcamera, PID: 7837
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.shigeki.timestampcamera/com.example.shigeki.timestampcamera.MainActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class com.example.shigeki.timestampcamera.TextureView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2455)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2517)
        at android.app.ActivityThread.access$800(ActivityThread.java:162)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:189)
        at android.app.ActivityThread.main(ActivityThread.java:5529)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
     Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.example.shigeki.timestampcamera.TextureView
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:757)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
        at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
        at com.example.shigeki.timestampcamera.MainActivity.onCreate(MainActivity.java:54)
        at android.app.Activity.performCreate(Activity.java:5966)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2408)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2517) 
        at android.app.ActivityThread.access$800(ActivityThread.java:162) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:189) 
        at android.app.ActivityThread.main(ActivityThread.java:5529) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745) 
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.shigeki.timestampcamera.TextureView" on path: DexPathList[[zip file "/data/app/com.example.shigeki.timestampcamera-1/base.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.shigeki.timestampcamera-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
        at android.view.LayoutInflater.createView(LayoutInflater.java:571)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
        at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) 
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) 
        at com.example.shigeki.timestampcamera.MainActivity.onCreate(MainActivity.java:54) 
        at android.app.Activity.performCreate(Activity.java:5966) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2408) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2517) 
        at android.app.ActivityThread.access$800(ActivityThread.java:162) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:189) 
        at android.app.ActivityThread.main(ActivityThread.java:5529) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745) 
        Suppressed: java.lang.ClassNotFoundException: com.example.shigeki.timestampcamera.TextureView
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                ... 23 more
     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

1 件の回答 1

0

Layoutファイルで元々

< com.example.shigeki.timestampcamera.TextureView
        android:id   ~~~
/>

となっていたところを

< TextureView
    android:id="@+id/textureview"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true" />

<FrameLayout
    android:id="@+id/control"
    android:layout_width="match_parent"
    android:layout_height="112dp"
    android:layout_alignParentBottom="true"
    android:layout_alignParentStart="true">

    <Button
        android:id="@+id/shutter"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center" />

</FrameLayout>

のように消してしまうことで解決しました。。

この質問に回答するには、ログインする必要があります。

求めていた回答ではありませんか? のタグが付いた他の質問を参照する。