Skip to content

Conversation

@iscle
Copy link
Contributor

@iscle iscle commented Feb 22, 2019

No functionality changes, only updated the target SDK to the latest one, migrated to AndroidX, replaced some of the deprecated APIs and refactored code to make it nicer.

No functionality changes were made.

I haven't updated the version number as I don't know what pattern you are following.

@iscle iscle changed the title Updated target SDK, migrated to AndroidX, replaced deprecated APIs and refactored code Updated target SDK, migrated to AndroidX, replaced (some) deprecated APIs and refactored code Feb 22, 2019
Removed some Lint flags that weren't needed any more, as well as replaced some deprecated APIs
Lint tool was complaining because some async methods used the context of an activity directly. Fixed it (or tryed to minimize problems) by doing classes static and by using WeakReferences.
@iscle
Copy link
Contributor Author

iscle commented Feb 22, 2019

I've now tried to fix some potential memory leaks that could happen with the AsyncTasks, it might not be the best approach possible, but at least better than nothing. Also updated code to Java 8 so we can make use of new features like lambda expressions which simplify code a lot.

@meefik meefik merged commit 06f4412 into meefik:master Feb 23, 2019
@meefik
Copy link
Owner

meefik commented Feb 23, 2019

Notification icon not shown, repository not working and I have this errors in Android 9:

2019-02-23 20:34:33.932 1935-1946/system_process E/NotificationService: No Channel found for pkg=ru.meefik.linuxdeploy, channelId=null, id=1, tag=null, opPkg=ru.meefik.linuxdeploy, callingUid=10067, userId=0, incomingUserId=0, notificationUid=10067, notification=Notification(channel=null pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x2 color=0x00000000 actions=2 vis=PRIVATE)
2019-02-23 20:34:44.295 1935-1947/system_process E/NotificationService: No Channel found for pkg=ru.meefik.linuxdeploy, channelId=null, id=1, tag=null, opPkg=ru.meefik.linuxdeploy, callingUid=10067, userId=0, incomingUserId=0, notificationUid=10067, notification=Notification(channel=null pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x2 color=0x00000000 actions=2 vis=PRIVATE)
2019-02-23 20:35:09.012 3166-3166/ru.meefik.linuxdeploy E/TypefaceCompatApi21Impl: java.lang.NoSuchMethodException
    java.lang.NoSuchMethodException: addFontWeightStyle [class java.lang.String, int, boolean]
        at java.lang.Class.getMethod(Class.java:2068)
        at java.lang.Class.getMethod(Class.java:1690)
        at androidx.core.graphics.TypefaceCompatApi21Impl.<clinit>(TypefaceCompatApi21Impl.java:74)
        at androidx.core.graphics.TypefaceCompat.<clinit>(TypefaceCompat.java:47)
        at androidx.core.graphics.TypefaceCompat.create(TypefaceCompat.java:190)
        at androidx.appcompat.widget.AppCompatTextView.setTypeface(AppCompatTextView.java:576)
        at android.widget.TextView.resolveStyleAndSetTypeface(TextView.java:2037)
        at android.widget.TextView.setTypefaceFromAttrs(TextView.java:2008)
        at android.widget.TextView.applyTextAppearance(TextView.java:3640)
        at android.widget.TextView.<init>(TextView.java:1498)
        at android.widget.TextView.<init>(TextView.java:869)
        at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:97)
        at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:93)
        at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:182)
        at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
        at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1267)
        at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1317)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:470)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:141)
        at ru.meefik.linuxdeploy.AboutActivity.onCreate(AboutActivity.java:15)
        at android.app.Activity.performCreate(Activity.java:7136)
        at android.app.Activity.performCreate(Activity.java:7127)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

@iscle
Copy link
Contributor Author

iscle commented Feb 23, 2019

Are you running Android Oreo or newer? That's because starting from Oreo, you need to create notfication channels for notifications.

This error must have been happening even before merging this! I could only test this under 7.1.1 and it worked fine.

However, let me fix it quickly, I'll create a new pull request ;)

@meefik
Copy link
Owner

meefik commented Feb 23, 2019

I tested in Android 9 from AVD. In Android 4 icon is displayed.

This error must have been happening even before merging this

Yes..

But the repository (Menu - Repository) not working after merging.

@iscle
Copy link
Contributor Author

iscle commented Feb 23, 2019

Perfect, I've just solved the notification issue, I need to fix the other error and it will be good to go.

Can you guide me on how to root the Android 9 AVD so that I can test builds myself?

Thanks

@full10
Copy link

full10 commented Feb 23, 2019 via email

@meefik
Copy link
Owner

meefik commented Feb 23, 2019

Now I tested without root in AVD. Earlier, I used https://github.com/meefik/avd-root. But it not working today.

@iscle
Copy link
Contributor Author

iscle commented Feb 23, 2019

Okay I've just opened a new pull request. As for the other error "java.lang.NoSuchMethodException: addFontWeightStyle [class java.lang.String, int, boolean]" this is a bug in android that google has to solve but it shouldn't affect functionality.

screenshot from 2019-02-23 19-25-38

@meefik
Copy link
Owner

meefik commented Feb 23, 2019

Thanks for the fix! :)

There is an understanding why the repository (Menu - Repository) does not work?

@iscle
Copy link
Contributor Author

iscle commented Feb 23, 2019

Works on Nougat but not on Pie... Interesting. I will look into it.

@iscle
Copy link
Contributor Author

iscle commented Feb 23, 2019

Done :)

@meefik
Copy link
Owner

meefik commented Feb 23, 2019

Great! A look another error:

2019-02-23 21:57:43.227 1828-1828/system_process E/LoadedApk: Unable to instantiate appComponentFactory
    java.lang.ClassNotFoundException: Didn't find class "androidx.core.app.CoreComponentFactory" on path: DexPathList[[],nativeLibraryDirectories=[/data/app/ru.meefik.linuxdeploy-OFmlQ9BsT1QSCuj4x0WYxw==/lib/x86_64, /system/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.LoadedApk.createAppFactory(LoadedApk.java:226)
        at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:338)
        at android.app.ActivityThread.handleDispatchPackageBroadcast(ActivityThread.java:5388)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1733)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at com.android.server.SystemServer.run(SystemServer.java:454)
        at com.android.server.SystemServer.main(SystemServer.java:294)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:838)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants