Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can use InAppBrowser with image_picker or permission _hander #53

Closed
yhdjy025 opened this issue Mar 8, 2019 · 13 comments
Closed

I can use InAppBrowser with image_picker or permission _hander #53

yhdjy025 opened this issue Mar 8, 2019 · 13 comments

Comments

@yhdjy025
Copy link

yhdjy025 commented Mar 8, 2019

It cause some android resource link failed error

@pichillilorenzo
Copy link
Owner

Do you have some error logs that I can see? thanks

@yhdjy025
Copy link
Author

Launching lib\main.dart on DUK AL20 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
ע: ijЩ�����ļ�ʹ�û򸲸����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
ע: ijЩ�����ļ�ʹ����δ�����򲻰�ȫ�IJ�����
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:unchecked ���±��롣
E:\www\km_app_flutter\android\app\src\main\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 17 declared in library [:flutter_inappbrowser] E:\www\km_app_flutter\build\flutter_inappbrowser\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 17,
or use tools:overrideLibrary="com.pichillilorenzo.flutter_inappbrowser" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 17 declared in library [:flutter_inappbrowser] E:\www\km_app_flutter\build\flutter_inappbrowser\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 17,
or use tools:overrideLibrary="com.pichillilorenzo.flutter_inappbrowser" to force usage (may lead to runtime failures)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 8s
Finished with error: Gradle task assembleDebug failed with exit code 1

@yhdjy025
Copy link
Author

if remove image_picker and permission_handler both, iit can run success

@pichillilorenzo
Copy link
Owner

You need to update the minSdkVersion of your build.gradle file to at least 17.

@yhdjy025
Copy link
Author

I have updated it as 17 but it cause another error

Running "flutter packages get" in km_app_flutter... 2.8s
Launching lib\main.dart on DUK AL20 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
D8: Program type already present: android.support.v4.app.INotificationSideChannel

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.app.INotificationSideChannel

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 35s


The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.


Finished with error: Gradle task assembleDebug failed with exit code 1

@yhdjy025
Copy link
Author

I have tested it several times., if add image_picker and permission_handler both it cause error as mentioned above.

@pichillilorenzo
Copy link
Owner

Ok, the problem here is the AndroidX incompatibilities! I need to update my plugin in order to support the new AndroidX!

Indeed, as the link https://goo.gl/CP92wY says:

Android code often uses the android.support libraries to ensure backwards compatibility. The android.support libraries are deprecated, and replaced with AndroidX. AndroidX has feature parity with the old libraries with some additional capabilities but, unfortunately, these two sets of libraries are incompatible.

@pcejas
Copy link

pcejas commented Mar 11, 2019

@yhdjy025
Copy link
Author

I am search from the network it tell me add
android.useAndroidX=true
android.enableJetifier=true
to gradle.properties file, I have try it ,but it print many messy code

Launching lib\main.dart on DUK AL20 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
ע: C:\flutter.pub-cache\hosted\pub.dartlang.org\connectivity-0.4.2\android\src\main\java\io\flutter\plugins\connectivity\ConnectivityPlugin.javaʹ�û򸲸����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\ChromeCustomTabsActivity.java:8: ����: �Ҳ�������
import android.support.customtabs.CustomTabsIntent;
^
����: �� CustomTabsIntent
�: ����� android.support.customtabs
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\ChromeCustomTabsActivity.java:20: ����: �����CustomTabsIntent������
CustomTabsIntent.Builder builder;
^
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\CustomTabActivityHelper.java:6: ����: �Ҳ�������
import android.support.customtabs.CustomTabsClient;
^
����: �� CustomTabsClient
�: ����� android.support.customtabs
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\CustomTabActivityHelper.java:7: ����: �Ҳ�������
import android.support.customtabs.CustomTabsIntent;
^
����: �� CustomTabsIntent
�: ����� android.support.customtabs
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\CustomTabActivityHelper.java:8: ����: �Ҳ�������
import android.support.customtabs.CustomTabsServiceConnection;
^
����: �� CustomTabsServiceConnection
�: ����� android.support.customtabs
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\CustomTabActivityHelper.java:9: ����: �Ҳ�������
import android.support.customtabs.CustomTabsSession;
^
����: �� CustomTabsSession
�: ����� android.support.customtabs
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\ServiceConnectionCallback.java:3: ����: �Ҳ�������
import android.support.customtabs.CustomTabsClient;
^
����: �� CustomTabsClient
�: ����� android.support.customtabs
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\CustomTabActivityHelper.java:17: ����: �Ҳ�������
private CustomTabsSession mCustomTabsSession;
^
����: �� CustomTabsSession
�: �� CustomTabActivityHelper
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\CustomTabActivityHelper.java:18: ����: �Ҳ�������
private CustomTabsClient mClient;
^
����: �� CustomTabsClient
�: �� CustomTabActivityHelper
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\CustomTabActivityHelper.java:19: ����: �Ҳ�������
private CustomTabsServiceConnection mConnection;
^
����: �� CustomTabsServiceConnection
�: �� CustomTabActivityHelper
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\CustomTabActivityHelper.java:30: ����: �Ҳ�������
CustomTabsIntent customTabsIntent,
^
����: �� CustomTabsIntent
�: �� CustomTabActivityHelper
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\CustomTabActivityHelper.java:58: ����: �Ҳ�������
public CustomTabsSession getSession() {
^
����: �� CustomTabsSession
�: �� CustomTabActivityHelper
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\CustomTabActivityHelper.java:103: ����: �Ҳ�������
public void onServiceConnected(CustomTabsClient client) {
^
����: �� CustomTabsClient
�: �� CustomTabActivityHelper
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\ServiceConnectionCallback.java:13: ����: �Ҳ�������
void onServiceConnected(CustomTabsClient client);
^
����: �� CustomTabsClient
λ��: �ӿ� ServiceConnectionCallback
C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_inappbrowser-0.6.0\android\src\main\java\com\pichillilorenzo\flutter_inappbrowser\ChromeCustomTabs\ServiceConnection.java:4: ����: �Ҳ�������
import android.support.customtabs.CustomTabsClient;

@liusxc
Copy link

liusxc commented Mar 11, 2019

I've got the same problem, expect your upgrade.

@pichillilorenzo
Copy link
Owner

I released the new version 1.0.0 with support for AndroidX!

@yhdjy025
Copy link
Author

Thank you!

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants