I'm currently developing, in Android Studio, a Google Endpoints application in java. I therefore have two different modules in the project:
A "backend" module where is all my code for the Google Endpoints backend (including java beans which define my model and data store data model and auto-generated Endpoints)
An "app" module where there is the code for the corresponding Android App which will talk to the back-end.
I get the following error in the "backend" error when I call isEmpty() on a string: "Call requires API level 9 (current min is 1): java.lang.String#isEmpty".
Note that:
It seems that this error only appeared when I started to add code to the Android "app" Module. Before that, during the last year, I didn't have any problem. OR it could be that it started when I upgraded to Android Studio 2.2
I can build and deploy the "backend" module to App Engine without any problem despite the error and the class with the error works correctly.
In the build.gradle fiel of the "app" module I have:
defaultConfig {
applicationId "com.xxxx.yyy"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
In the Android Manifest of the Android app I didn't have any uses-sdk declaration. Adding one with e.g. android:minSdkVersion="14" didn't change anything.
I can build and deploy the "backend" module to App Engine without any problem despite the error and the class with the error works correctly.
I get the error in any class of the "backend" module: a simple bean, a generated Endpoint that I modify, or a "custom made" Servlet.
Related
I have angular 8 front end application in production and its Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
This issue is happening only in production build that too not always , able reproduce only sometimes.
main-es2015.fcc7123d15fd9c113b00.js:1
vendor-es2015.d8d7d81cc2b06ece8c91.js:1
How do i fix it.?
Are you using serviceWorker?
If so you have to add inside angular.json "serviceWorker": true for the configuration that you are using.
I would like to share my experience with the same issue I was facing in the organization where I'm working.
I had an Angular 9 application and when I deployed to Stage environment, I got three errors in my console which showed as "module not loaded due to Mime type". This was working fine in all other environment and after much struggle, it was found that the files under the website were not having access. E.g. When you deploy an Angular application, you will get index.html file and many other js files. The website had permission issues. The site was hosted in the Rackspace and the FireWall was not configured to have access to the files right under the website.
Once the below access was provided, the app started working.
/assets*
/*.css
/*.js
/*.ico
/*.html
The only difference I see with your problem is that you have mentioned it is working sometimes.
There is another post Blocked because of a disallowed MIME type (“text/html”) : Angular 8 deployed on tomcat 9.0.30 fails to serve the assets try the solution based on base reference as those js files are not served/loaded
I hope this might help someone.
We created a Linux Web App in Microsoft Azure. The application is static written with React (html and Javascript).
We copied the code into the wwwroot folder, but the application only showing only hostingstart.html and when we try to get page index.html we have this error:
Cannot GET /index.html
We tried with a sample of Azure in GitHub (https://github.com/Azure-Samples/html-docs-hello-world) but the error is the same.
The url is this: https://consoleadmin.azurewebsites.net/index.html
Last week the application was running correctly.
We forget to do something?
MAY 2020 - You don't have to add any javascript files or config files anywhere. Let me explain.
I was facing this exact same issue and wasted 6 hours trying everything including the most popular answer to this question. While the accepted answer is a nice workaround (but requires more work than just adding the index.js file), there's something a simpler than that.
You see, when you just deploy an Azure Web App (or App Service as it is also called), two things happen:
The web app by default points to opt/startup/hostingstart.html
It also puts a hostingstart.html in home/site/wwwroot
When you deploy your code, it replaces hostingstart.html in home/site/wwwroot but the app is still pointing to opt/startup/hostingstart.html. If you want to verify this, try deleting opt/startup/hostingstart.html file and your web app will throw a "CANNOT GET/" error.
So how to change the default pointer? It's simpler than it looks:
Go to Configuration tab on your web app and add the following code to startup script:
pm2 serve /home/site/wwwroot --no-daemon
If this web app is a client-side single-page-app and you're having issues with routing, then add --spa to the above command as follows:
pm2 serve /home/site/wwwroot --no-daemon --spa
This will tell the web app to serve wwwroot folder. And that's it.
Image for reference:
Screenshot explaination
PS: If you only set the startup script without deploying your code, it will still show the hostingstart.html because by default that file lies in the wwwroot folder.
Ok you are gonna love this. This happened to me today also. Same exact thing.
I am pretty sure the azure team flipped a switch somewhere and we fell through a crack.
I found this obscure answer with no votes and it did the trick (with a little extra finagling)
BONUS! this also fixed my router issues I was having only on the deployed site (not local):
Credit: #stormwild: Default documents not serving on node web app hosted on Azure
From #stormwild's post see here:
https://blogs.msdn.microsoft.com/waws/2017/09/08/things-you-should-know-web-apps-and-linux/#NodeHome
Steps:
Go to your azure portal, select your app service and launch ssh
In ssh terminal, navigate via command line to /home/site/wwwroot
create index.js there with the following code:
var express = require('express');
var server = express();
var options = {
index: 'index.html'
};
server.use('/', express.static('/home/site/wwwroot', options));
server.listen(process.env.PORT);
NOTE: Be sure to run npm install --save express also in this folder else your app service will crash on startup
Be sure to restart your app service if it doesn't do so automagically
A workaround, I changed the webapp stack to PHP 7
Another solution would be to add a file called ecoysystem.config.js right next to your index.html file.
module.exports = {
apps: [
{
script: "npx serve -s"
}
]
};
This will tell pm2 to associate all requests to index.html as your app service starts up.
Very helpful information here: https://burkeholland.github.io/posts/static-site-azure/
I am getting following error when I am running "goapp serve myapp/" from Myproject folder inside src.
go-app-builder: Failed parsing input: parser: bad import "unsafe" in
github.com/gorilla/websocket/client.go from GOPATH
my file structure is some something like this
$GOPATH/src
|-github.com/gorilla/websocket
|-MyProject
|-myapp
|-app.yaml
|-mainApp.go (which contain init function and part of app package)
Please let me know how to correct this.
on a related subject, I read that google app provide websocket support only in paid app. Is there a way for me to test my website before getting into payment mode? Or is there a better option that google app engine?
I am unable to deploy my angular 2 app with angular cli:
angular-cli: 1.0.0-beta.14
node: 6.4.0
os: darwin x64
The deployed site logs error messages telling that the inline.js, main...bundle.js, styles...bundle.js, favicon.ico Failed to load with status 404.
Everything works fine locally but problem starts when in production deploying to Github pages.
The base href is also properly set. May be a problem in CSP???
Kindly guide(Already lost 2 days) Error Screenshot
Actually I sorted out it just now!
I see that when site is deployed using the ng github-pages:deploy, the site that is generated will have site url like:
xyz.github.io/ng-app
and also the base url will be set like ng-app. Thing I did was set a variable baseUrl: "/ngApp" and set the base url to <base href="{{baseURL}}"> and everything is working now. I guessed that it picked up the app name specified in the angular-cli.json and so it did not match the repo name in github etc... thanks #shusson anyway
I am trying to convert Google Web Application to EAR application (backends into modules).I have created EAR Project and dynamic Web projects for modules. I have added old front-end code to the default module & back-ends code to the other modules. Facing problem while adding data to the datastore .The old Project which uses front end back-ends working properly,Problem comes when converting backends into module & tx.begin() throws Exception .I have created package.jdo for jdo configuration.
Software configuration:- Eclipse-Juno,Google App Engine SDK:- 1.8.5,JDK:- 1.7.0_65,JDO:-JDO 2.3,DataNucleus Eclipse Plugins :-4.0.0.
PersistenceManager pm = null;
pm = PMF.get().getPersistenceManager();
tx = pm.currentTransaction();
tx.begin();
pm.makePersistent(dataObj);
tx.commit();*
This is DataNucleaus Enhancement issue. Provide correct jdo files to
persistent.xml and Enhance Project. Run the project when all classess
enhanced(You will get message on console, how many classess were
enhanced.)