Я создал приложение на основе WebView
, которое устанавливается на некоторых устройствах, но не устанавливается на других.Я проверил это на Android версии 4, 6, 7. Проблема не с версией Android.На некоторых устройствах написано Problem occurs when parsing the package
или Application package installer has stopped unexpectedly
.
Примечание. У меня проблемы с Samsung j7 Prime, Mi A1 и некоторыми другими.Но никаких проблем в Mi Note 3, Oppo f3 и некоторых других.
Что я делаю не так?Это мой activity_main.xml
:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent"
android:layout_width="match_parent">
<im.delight.android.webview.AdvancedWebView
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.MainActivity"
android:id="@+id/webview">
</im.delight.android.webview.AdvancedWebView>
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="id">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
А это мой AndroidManifest.xml
:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
А это мой build.gradle
:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.8.1'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.rimikri.smartpedi"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
//OneSignal
manifestPlaceholders = [
onesignal_app_id: 'id',
onesignal_google_project_number: 'REMOTE'
]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compile 'com.onesignal:OneSignal:[3.8.3, 3.99.99]'
compile 'com.github.delight-im:Android-AdvancedWebView:v3.0.0'
compile 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
compile 'com.google.firebase:firebase-ads:15.0.0'
implementation 'com.facebook.android:audience-network-sdk:4.27.1'
implementation 'com.google.ads.mediation:facebook:4.27.1.0'
}
apply plugin: 'com.google.gms.google-services'
Заранее спасибо за предложение.