goweii / WanAndroid

最美WanAndroid客户端
https://github.com/goweii/WanAndroid
GNU General Public License v2.0
952 stars 185 forks source link

master主干版本2.0.10,编译运行后,点击首页文章,后台报错,也没有进行跳转。但是升级2.0.13就可以了。 #55

Closed otaserver closed 2 years ago

otaserver commented 3 years ago

2021-07-20 11:51:33.603 7462-7462/com.goweii.wanandroid E/CrashHandler: CrashHandler.uncaughtException(CrashHandler.kt:57):java.lang.IllegalArgumentException: Illegal URL: null/ at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:456) at per.goweii.rxhttp.request.RequestClientManager.create(RequestClientManager.java:130) at per.goweii.rxhttp.request.RequestClientManager.getRetrofit(RequestClientManager.java:108) at per.goweii.rxhttp.request.RequestClientManager.getService(RequestClientManager.java:70) at per.goweii.rxhttp.request.Api.api(Api.java:36) at per.goweii.wanandroid.http.CmsApi.access$api$s66042(CmsApi.kt:19) at per.goweii.wanandroid.http.CmsApi$Companion.api(CmsApi.kt:24) at per.goweii.wanandroid.module.main.model.CmsCommentRequest.commentCount(CmsCommentRequest.kt:44) at per.goweii.wanandroid.module.main.presenter.ArticlePresenter.commentCount(ArticlePresenter.kt:54) at per.goweii.wanandroid.module.main.activity.ArticleActivity.loadData(ArticleActivity.kt:299) at per.goweii.basic.core.mvp.MvpActivity.initialize(MvpActivity.java:75) at per.goweii.basic.core.base.BaseActivity.initialize(BaseActivity.java:47) at per.goweii.basic.core.mvp.MvpActivity.onCreate(MvpActivity.java:70) at per.goweii.basic.core.base.BaseActivity.onCreate(BaseActivity.java:38) at android.app.Activity.performCreate(Activity.java:7893) at android.app.Activity.performCreate(Activity.java:7880) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at per.goweii.ponyo.crash.Crash$Companion$initialize$1.run(Crash.kt:23) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.goweii.wanandroid/per.goweii.wanandroid.module.main.activity.ArticleActivity}: java.lang.IllegalArgumentException: Illegal URL: null/ at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3308) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at per.goweii.ponyo.crash.Crash$Companion$initialize$1.run(Crash.kt:23) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

otaserver commented 3 years ago

自问自答一下:看到flavor.gradle中,CMS_BASE_URL是需要设置值,在local.properties中增加这个属性就可以了。类似还有其他多个属性,作者能给个模板就好了,或者在README中做个说明。

otaserver commented 3 years ago

编译basic_res:verifyReleaseResources任务报错,报颜色属性找不到。 Execution failed for task ':basic_res:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade 1 exception was raised by workers: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed C:\WanAndroid\basic_res\src\main\res\values\themes.xml:4:5-65:13: AAPT: error: style attribute 'attr/colorPrimary (aka per.goweii.basic.res:attr/colorPrimary)' not found.

 C:\WanAndroid\basic_res\src\main\res\values\themes.xml:4:5-65:13: AAPT: error: style attribute 'attr/colorPrimaryDark (aka per.goweii.basic.res:attr/colorPrimaryDark)' not found.

 C:\WanAndroid\basic_res\src\main\res\values\themes.xml:4:5-65:13: AAPT: error: style attribute 'attr/colorAccent (aka per.goweii.basic.res:attr/colorAccent)' not found.
goweii commented 3 years ago

已屏蔽cms

otaserver commented 3 years ago

再回复一下颜色属性问题的解决办法:config.gradle中design属性是直接写的版本号design : "com.google.android.material:material:1.0.0", 建议可以提取版本号,现在最新版本是1.4.0,然后在basic_res库的build.gradle中增加依赖即可解决此问题。 dependencies { api rootProject.ext.dependencies.design } 另外:app界面小清新,给作者点赞!

goweii commented 2 years ago

已移除评论系统