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

Android Webview issue #3243

Closed
kyriakosproto opened this issue Nov 20, 2017 · 5 comments
Closed

Android Webview issue #3243

kyriakosproto opened this issue Nov 20, 2017 · 5 comments

Comments

@kyriakosproto
Copy link

Hello,

We experience an issue when we preview aframe scenes through Webview in Android apps after Chrome/Webview update to version 62.0 (was working fine on previous versions). The aframe scene initializes and works fine but it does not respond to the device movements (seems like it doesn't communicate with gyroscope to update vr camera's rotation), although rotation using touch events works fine.

We have this problem embedding our project, that uses aframe version 0.5, also had the same result when we tried to embed examples from aframe's website (including https://aframe.io/examples/showcase/helloworld/ which uses version 0.7)

The following permissions/features are defined in AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.sensor.gyroscope" />

Here is a snippet of the webview initialization code from the Activity class file

WebView webView = (WebView) findViewById(R.id.webview);
       WebSettings webSettings = webView.getSettings();
       webSettings.setJavaScriptEnabled(true);
       webSettings.setBuiltInZoomControls(true);
       webSettings.setAllowContentAccess(true);
       webSettings.setAllowFileAccess(true);
       webSettings.setAllowFileAccessFromFileURLs(true);
       webSettings.setAllowUniversalAccessFromFileURLs(true);
       webSettings.setAppCacheEnabled(true);
       webSettings.setBlockNetworkImage(false);
       webSettings.setBlockNetworkLoads(false);
       webSettings.setDatabaseEnabled(true);
       webSettings.setDomStorageEnabled(true);
       webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
       webSettings.setLoadsImagesAutomatically(true);
       webSettings.setSupportZoom(true);
webView.loadUrl("https://aframe.io/examples/showcase/helloworld/");

Following are the contents of the build.gradle file

apply plugin: 'com.android.application'

android {
   compileSdkVersion 25
   buildToolsVersion "25.0.3"
   defaultConfig {
       applicationId "xxxxxxx"
       minSdkVersion 16
       targetSdkVersion 25
       versionCode 1
       versionName "1.0"
       testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
   }
   buildTypes {
       release {
           minifyEnabled false
           proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
       }
   }
}

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
       exclude group: 'com.android.support', module: 'support-annotations'
   })
   compile 'com.android.support:appcompat-v7:25.3.1'
   compile 'com.android.support.constraint:constraint-layout:1.0.2'
   compile 'com.android.support:design:25.3.1'
   testCompile 'junit:junit:4.12'
}

we tested this on 2 Android devices:

  • A-Frame Version: 0.5, 0.7
  • Platform / Device:
  1. Nexus 5 with Android version 6.0.1 and System Webview 62.0.3202.84
  2. Google Pixel with Android version 8.0.0 and Chrome version 62.0.3202.84

Does anyone else have this issue? or knows if there is a fix for that?

@meatwallace
Copy link

Issue is specific to Android System WebView 62.x or a WebView using Chrome 62.x. It's resolved in Chrome 63, 11 days away from release. We've bundled the CrossWalk WebView with our app and are conditionally using it when we detect the user has 62.x installed.

@dmarcos
Copy link
Member

dmarcos commented Dec 17, 2017

Chrome 63 should have shipped. @meatwallace @kyriakosproto Can you confirm if this issue is gone?

@meatwallace
Copy link

@dmarcos - definitely resolved in Chrome 63.

@dmarcos
Copy link
Member

dmarcos commented Dec 20, 2017

Cool, thanks!

@dmarcos dmarcos closed this as completed Dec 20, 2017
@jhfrek
Copy link

jhfrek commented Feb 9, 2020

Сайт должен начинаться с https, тогда будет работать.

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

No branches or pull requests

4 participants