私は成功裏にドキュメントに従ってhttps://github.com/lzyzsd/CircleProgressを使用しました。NoClassDefFoundError aarをインポートした後
compile 'com.github.lzyzsd:circleprogress:[email protected]'
<com.github.lzyzsd.circleprogress.DonutProgress
xmlns:custom="http://schemas.android.com/apk/res-auto"
custom:donut_finished_stroke_width="4dp"
custom:donut_unfinished_stroke_width="3dp"
custom:donut_progress="40"/>
しかし、私はGitリポジトリに追加された属性donut_circle_starting_degree
を逃したが、新しいバージョンがリリースされていません。そこで、私はこのライブラリをダウンロードしてローカルにパッケージ化しました。私はaarからモジュールをインポートするためにAndroidスタジオ機能を使用しました。
このモジュールをオリジナルのモジュールにコンパイル依存として追加しました。コンパイルは正常ですが、実行時に失敗します:
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.github.lzyzsd.circleprogress.DonutProgress" on path: DexPathList[[zip file "/data/app/lelisoft.com.lelimath-1/base.apk"],nativeLibraryDirectories=[/data/app/lelisoft.com.lelimath-1/lib/arm64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at android.view.LayoutInflater.createView(LayoutInflater.java:583)
Suppressed: java.lang.ClassNotFoundException: com.github.lzyzsd.circleprogress.DonutProgress
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)
... 28 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
他のインポートオプションをテストしました。これは、同様の質問https://stackoverflow.com/a/32598823/1639556
1.1依存関係workwそれをインポートするプロジェクトをきれいにしようとされていますが、1.2は存在しません。私は1.0が最初で最も古いバージョンだと思いますか? –